我正在尝试将索引 3-7 中的“D”值设置为 0,这是我收到的代码,但出现错误。
df.iloc[3:7, 'D'] = 0
我也试过:
df.iloc[3:7]['D'] = 0
A B C D 0 foo one small 1 1 foo one large 2 2 foo one large 2 3 foo two small 3 4 foo two small 3 5 bar one large 4 6 bar one small 5 7 bar two small 6 8 bar two large 7
梦里花落0921
富国沪深
四季花海
相关分类