I want to see the datatype of all columns stored in my dataframe without iterating over them. What is the way?
I want to see the datatype of all columns stored in my dataframe without iterating over them. What is the way?
Use the DataFrame.info() method
>>> df.info()
RangeIndex: 5 entries, 0 to 4
Data columns (total 3 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 int_col 5 non-null int64
1 text_col 5 non-null object
2 float_col 5 non-null float64
dtypes: float64(1), int64(1), object(1)
memory usage: 248.0+ bytes
Docs: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.info.html