python pandas:检索除指定列之外的所有数据帧 [英] python pandas: retrieve dataframe of all but one specified column
本文介绍了python pandas:检索除指定列之外的所有数据帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在熊猫数据框对象中选择除列之外的所有列?我已经看到删除列的方法,但我不想这样做。
Is there a way to select all but one column in a panda dataframe object? I've seen ways to delete a column, but I don't want to do that.
推荐答案
使用 drop
方法:
df.drop(column_name, axis=1)
这篇关于python pandas:检索除指定列之外的所有数据帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文