>>df ABCD E 0 0 0 0 F 0 0 0 0 G 0 0 0 0 H 0 0 0 0 It is necessary to change the cell df[A][E] .
Using df[A][E] = 2 leads to a warning.
Use DataFrame.loc[<index_slice>, <column_slice>] :
In [7]: df.loc['E','A'] = 111 In [8]: df Out[8]: ABCD E 111 0 0 0 F 0 0 0 0 G 0 0 0 0 H 0 0 0 0 or DataFrame.at[...] :
In [10]: df.at['E', 'A'] = 222 In [11]: df Out[11]: ABCD E 222 0 0 0 F 0 0 0 0 G 0 0 0 0 H 0 0 0 0 Source: https://ru.stackoverflow.com/questions/909591/
All Articles