Answers for "filter dataframe columns vy a list of columns"

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 "filter dataframe columns vy a list of columns"

Python Answers by Framework

Browse Popular Code Answers by Language