pandas how to check dtype for all columns in a dataframe?

后端 未结 3 686
一生所求
一生所求 2021-01-30 00:05

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

3条回答
  •  渐次进展
    2021-01-30 00:38

    Suppose df is a pandas DataFrame then to get number of non-null values and data types of all column at once use:

    df.info()
    

提交回复
热议问题