Get list of pandas dataframe columns based on data type
If you want a list of columns of a certain type, you can use groupby: >>> df = pd.DataFrame([[1, 2.3456, ‘c’, ‘d’, 78]], columns=list(“ABCDE”)) >>> df A B C D E 0 1 2.3456 c d 78 [1 rows x 5 columns] >>> df.dtypes A int64 B float64 C object D object E int64 dtype: … Read more