Pandas how to check dtype for all columns in a data frame?

It seems that dtype only works for pandas.DataFrame.Series, right? Is there a function to display data types of all columns at the same time?

+6
source share
1 answer

Use dtypes to get data types for all columns. Suppose I have a data frame of four ABCD columns as follows:

 df.A.dtype # dtype('float64') df.dtypes # A float64 # B float64 # C float64 # D float64 # dtype: object 
+8
source

Source: https://habr.com/ru/post/1011904/


All Articles