title: SettingwithcopyWarning: while try to use .sort_values in pandas
body: <p>I am trying to sort a dataframe by total column:</p>
  <pre><code>df.sort_values(by='Total', ascending=False, axis=0, inplace =True)
  </code></pre>
  <p>But I'm getting the following warning:</p>
  <pre><code>/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:1: SettingWithCopyWarning: 
  A value is trying to be set on a copy of a slice from a DataFrame
  
  See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
    &quot;&quot;&quot;Entry point for launching an IPython kernel.
  </code></pre>
  <p>When I followed the link it opens up and using <code>.loc</code> methods is suggested. But after that I followed the <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sort_values.html" rel="noreferrer">.sort_values()</a> where I find out to use inplace = False or None.</p>
  <p>My question is what if I got a dataframe columns which is not sorted, and if I don't use inplace = True, my dataframe will be sorted for further use or I have to assigned a new name to the dataframe and saved it.</p>