title: A problem changing a specific column in a row in Pandas
body: <p>I'm a new learner of Python. Today I tried to do my course work on Pandas.
  It asks me to open a .json file and use a .csv file to cross-reference with it.
  Like the code below</p>
  <pre><code>with open('captions_train2017.json') as json_data:
      data = json.load(json_data)
      
  df_ct_ant=pd.DataFrame(data['annotations'])    
  df_csm=pd.read_csv(&quot;coco_subset_meta.csv&quot;)
  df_ct_ant['filename']=''
  
  for i,row in df_csm.iterrows():
      #index = df_ct_ant[df_ct_ant['image_id'] == row['id']].index.tolist()
      mask=(df_ct_ant['image_id'] == row['id'])
      df_ct_ant.loc[mask,'filename']=row['file_name']
      print(df_ct_ant.loc[mask])
  df_ct_ant
  </code></pre>
  <p>If I inspect its result in the loop, it shows that I change it successfully.</p>
  <p><a href="https://i.stack.imgur.com/X3lAq.png" rel="nofollow noreferrer">1</a></p>
  <p>But if I check the result on the whole dataframe, it only changes one column.</p>
  <p><a href="https://i.stack.imgur.com/JuuQz.png" rel="nofollow noreferrer">2</a></p>
  <p>I want to know why this happened and how to implent this function.Thanks.</p>