title: Change values in a column to np.nan based upon row index
body: <p>I want to selectively change column values to np.nan.</p>
  <p>I have a column with a lot of zero (0) values.</p>
  <p>I am getting the row indices of a subset of the total.</p>
  <p>I place the indices into a variable (s0).</p>
  <p>I then use this to set the column value to np.nan for just the rows whose index is in s0.</p>
  <p>It runs, but it is changing every single row (i.e., the entire column) to np.nan.</p>
  <p>Here is my code:</p>
  <pre><code>print((df3['amount_tsh'] == 0).sum())  # 41639  &lt;-- there are this many zeros to start
  # print(df3['amount_tsh'].value_counts()[0])
  s0 = df3['amount_tsh'][df3['amount_tsh'].eq(0)].sample(37322).index  #  grab 37322 row indexes
  print(len(s0))  # 37322
  df3['amount_tsh'] = df3.loc[df3.index.isin(s0), 'amount_tsh'] = np.nan  #  change the value in the column to np.nan if it's index is in s0
  print(df3['amount_tsh'].isnull().sum())
  </code></pre>