Pandas dtypes: Checking column types with dtype and value_counts

Pandas dtypes: Checking column types with dtype and value_counts

Get the dtype of a Python Pandas series with dtype:

df['trip_distance'].dtype

Get the dtypes of all columns in a data frame with “dtypes”, which returns a series:

df.dtypes

How many of each dtype? Use value_counts:

df.dtypes.value_counts()