Answers for "how to find categorical columns in pandas"

1

python dataframe get numeric columns

dfnew = df.select_dtypes(include=np.number)
Posted by: Guest on November-19-2020
2

display all categorical column in pandas dataframe

# get all categorical columns in the dataframe
catCols = [col for col in df.columns if df[col].dtype=="O"]
Posted by: Guest on May-30-2021
0

python dataframe get numeric columns

dfnew = df._get_numeric_data()
Posted by: Guest on November-19-2020

Code answers related to "how to find categorical columns in pandas"

Python Answers by Framework

Browse Popular Code Answers by Language