Answers for "pandas remove all columns starting with"

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
0

remove columns that start with pandas

cols = [c for c in df.columns if c.lower()[:6] != 'string']
df=df[cols]
Posted by: Guest on March-16-2021

Code answers related to "pandas remove all columns starting with"

Python Answers by Framework

Browse Popular Code Answers by Language