【发布时间】:2018-12-04 12:19:36
【问题描述】:
似乎有一个逻辑错误。当我运行代码时,最后一列没有被删除。
感谢任何帮助
A = [['Roy', 80, 75, 85, 90, 95, 0],
['John', 75, 80, 75, 85, 100, 0],
['Dave', 80, 80, 80, 90, 95, 0]]
A = pd.DataFrame(A)
这里我做一些操作来识别
# Remove columns that meet a certain criteria.
# This statement does not seem to be working because
# at the end I get the same matrix without removing any column
A.drop(A.columns[i], axis=1)
【问题讨论】:
-
A=A.drop(A.columns[i], axis=1) 只需将其分配回去
标签: python python-3.x pandas dataframe