title: Pandas loc error: 'Series' objects are mutable, thus they cannot be hashed
body: <p>I need some help with a problem in handling pandas DataFrames. Here is the Code:</p>
  <pre><code>df.drop(df.index[0], inplace=True)
  df.columns = ['Mic. No.', 'X', 'Y', 'Z', 'Re. Pre.', 'Im. Pre.']
  df['Pre'] = df['Re. Pre.'] + df['Im. Pre.'] * 1j
  df.drop(['Mic. No.', 'Re. Pre.', 'Im. Pre.'], axis=1, inplace=True)
  
  if z != 0:
     df = df.loc(df['Z'] == z)
  </code></pre>
  <p>I loaded an excel sheet in a panda dataframe. Now after some preprocessing the DataFrame is in the following form:</p>
  <pre><code>          X         Y     Z                       Pre
    1      0.16      0.16  0.05   (1.0048704-0.51310315j)
    2      0.16     -0.16  0.05   (0.24814222-1.6094971j)
    3     -0.16      0.16  0.05   (0.24815122-1.6094059j)
    4     -0.16     -0.16  0.05   (1.0048704-0.51310315j)
    5 -0.154993  0.154993  0.05  (-0.13939651-1.7231593j)
  </code></pre>
  <p>now I want to delete all columns in the DataFrame which don't have the Value z in the column &quot;Z&quot;. I get the error: &quot;TypeError:'Series' objects are mutable, thus they cannot be hashed&quot;. I don't know what to do because how I see it it's exactly the same like in the pandas documentation. <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.loc.html" rel="nofollow noreferrer">https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.loc.html</a></p>
  <pre><code>df.loc[df['shield'] &gt; 6]
                 max_speed  shield
   sidewinder          7       8
  </code></pre>