Answers for "delete alla columns of a dataframe exept of one"

2

pandas drop all columns except certain ones

df.drop(df.columns.difference(['a','b']), 1, inplace=True)
Posted by: Guest on December-02-2020

Code answers related to "delete alla columns of a dataframe exept of one"

Python Answers by Framework

Browse Popular Code Answers by Language