title: Pandas .at not working and the dataframe doesn't change
body: <p>Having a large <code>DataFrame</code> of text, I want to first train and LDA model on it. So I do:</p>
  
  <pre><code>doc_clean = df['tweet_tokenized'].tolist()
  dictionary = corpora.Dictionary(doc_clean)
  doc_term_matrix = [dictionary.doc2bow(doc) for doc in doc_clean]
  lda = LdaMulticore(doc_term_matrix, id2word=dictionary, num_topics=50)
  </code></pre>
  
  <p>Now that I  have my trained <code>lda</code>, I want to iterate throw <code>df</code> row by row and put the probability of each row belonging to a given topic to its corresponding column. So, first I create 50 columns of zeros:</p>
  
  <pre><code>for i in range(50):
      col_name = 'tweet_topic_'+str(i)
      df[col_name] = 0
  </code></pre>
  
  <p>Then I iterate through the rows using <code>iterrows()</code> and update the values using the <code>at</code> method: </p>
  
  <pre><code>for row_index, row in df.iterrows():
      new_doc = dictionary.doc2bow(row['tweet_tokenized'])
      lda_result = lda[new_doc]
      for topic in lda_result:
          col_name = 'tweet_topic_'+(str(topic[0]))
          df.at[row_index,col_name] = topic[1]
  </code></pre>
  
  <p>But it doesn't work properly and the values of the above 50 columns doesn't change and remain zeros.</p>
  
  <p>Any idea how should I resolve this?</p>
  
  <p>UPDATE:
  I added <code>row = row.copy()</code> and replaced <code>at</code> with <code>loc</code> and it works well now.</p>
  
  <p>So here is the working code:</p>
  
  <pre><code>for row_index, row in df.iterrows():
      row = row.copy()
      new_doc = dictionary.doc2bow(row['tweet_tokenized'])
      lda_result = lda[new_doc]
      for topic in lda_result:
          col_name = 'tweet_topic_'+(str(topic[0]))
          df.loc[row_index,col_name] = topic[1]
  </code></pre>