how to drop all columns in panda except one code example
Example: pandas drop all columns except certain ones
df.drop(df.columns.difference(['a','b']), 1, inplace=True)
df.drop(df.columns.difference(['a','b']), 1, inplace=True)