I am trying to figure out how to quickly remove columns in df using a list of column names. this is a fancy feature reduction technique. This is what I use now, and it happens forever. Any suggestions are welcome.
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()
source share