Can't execute Python Pandas set_value
<p>Got a problem with Pandas in Python 3.5</p>

<p>I read local csv using Pandas, the csv contains pure data, no header involved. Then I assigned column name using </p>

<pre><code>df= pd.read_csv(filePath, header=None)
df.columns=['XXX', 'XXX'] #for short, totally 11 cols
</code></pre>

<p>The csv has 11 columns, one of them is string, others are integer. </p>

<p>Then I tried to replace string column by integer value in a loop, cell by cell</p>

<pre><code>for i, row in df.iterrows():
    print(i, row['Name'])
    df.set_value(i, 'Name', 123)
</code></pre>

<p>intrger 123 is an example, not every cell under this column is 123. 
print function works well if I remove set_value, but with </p>

<pre><code>df.set_value(i, 'Name', 123)
</code></pre>

<p>Then error info:   </p>

<blockquote>
  <p>Traceback (most recent call last):   File "D:/xxx/test.py", line 20,
  in 
      df.set_value(i, 'Name', 233)</p>
  
  <p>File
  "E:\Users\XXX\Anaconda3\lib\site-packages\pandas\core\frame.py", line
  1862, in set_value
      series = self._get_item_cache(col)</p>
  
  <p>File
  "E:\Users\XXX\Anaconda3\lib\site-packages\pandas\core\generic.py",
  line 1351, in _get_item_cache
      res = self._box_item_values(item, values)</p>
  
  <p>File
  "E:\Users\XXX\Anaconda3\lib\site-packages\pandas\core\frame.py", line
  2334, in _box_item_values</p>
  
  <p>return self._constructor(values.T, columns=items, index=self.index) </p>
  
  <p>AttributeError: 'BlockManager' object has no
  attribute 'T'</p>
</blockquote>

<p>But if I create a dataframe manually in code</p>

<pre><code>df = pd.DataFrame(index=[0, 1, 2], columns=['x', 'y'])
df['x'] = 2
df['y'] = 'BBB'
print(df)
for i, row in df.iterrows():
    df.set_value(i, 'y', 233)


print('\n')
print(df)
</code></pre>

<p>It worked. I am wondering maybe there is something I am missing?</p>

<p>Thanks!</p>