【发布时间】:2017-03-28 19:34:00
【问题描述】:
我正在尝试找出使用列名列表在 df 中删除列的最快方法。这是一种花哨的特征缩减技术。 这就是我现在正在使用的,并且需要永远。任何建议都非常感谢。
important2=(important[:-(len(important)-500)])
for i in important:
if i in important2:
pass
else:
df_reduced.drop(i, axis=1, inplace=True)
df_reduced.head()
【问题讨论】: