Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
pandas drop all columns except certain ones
Dispenser
Programming language:
Python
2021-07-19 11:38:17
0
Q:
pandas drop all columns except certain ones
vinayHR
Code:
Python
2021-06-12 07:26:10
df.drop(df.columns.difference(['a','b']), 1, inplace=True)
-1
Tags
columns
pandas
Related
loop through dataframe column and return unique value
find all nan columns pandas
python extract values that have different values in a column
pandas select all columns except one
see all columns pandas
remove all rows without a value pandas
keep all duplicates in a pandas dataframe
pandas iloc select certain columns
drop duplicates pandas first column
python - subset specific columns name in a dataframe
pd count how many item occurs in another column
pandas see all columns
pandas count specific value in column
python - show repeted values in a column
remove row if all are the same value pandas
python: remove specific values in a dataframe
drop multiple columns pandas
New to Communities?
Join the community