Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何一次删除多个列?我知道这行得通
del df['A'] del df['B']
但
del df[['A', 'B']]
没有。
您可以使用.drop:
.drop
df = df.drop(['A', 'B'], axis=1)