How to Get the Data Types of Each Columns in Pandas ?

Spread the love

To get the data types of each columns in pandas, we can use the dtype attribute of the pandas dataframe (pandas.DataFrame.dtypes). This returns a Series with the data type of each column.

Let’s read a dataset.

import pandas as pd

url = ''
df = pd.read_csv(url)

Let’s use the dtypes attribute to get the Data types of each columns.


Rating: 1 out of 5.

Leave a Reply