我正在尝试用Python编写代码,我的代码会一直返回一个警告标志,指出:
“正在尝试在DataFrame的切片副本上设置值”
我已将我的代码包括在内:
This is my code! I am trying to assign a value to the Month column
答案 0 :(得分:0)
您需要使用pandas索引器之一(ix,iloc,loc)来阻止此警告。由于您按位置编制索引,因此应使用iloc。
例如:
msft3.ix['P Values'].iloc[i] = ...