Answers for "pandas how to filter out columns from a list"

4

filter dataframe with list

df[df['Your_Column'].isin([3, 6])]
Posted by: Guest on May-25-2020
1

filter dataframe columns vy a list of columns

df.loc[:, df.columns.isin(['nnn', 'mmm', 'yyy', 'zzzzzz'])]

   yyy  nnn  mmm
0   10    5    5
1    9    3    4
2    8    7    0
Posted by: Guest on February-17-2021

Code answers related to "pandas how to filter out columns from a list"

Python Answers by Framework

Browse Popular Code Answers by Language