Why does pd.concat change the resulting datatype from int to float?

后端 未结 2 1108
悲哀的现实
悲哀的现实 2021-02-07 22:06

I have three dataframes: timestamp (with timestamps), dataSun (with timestamps of sunrise and sunset), dataData (with different climate data). Dataframe timestamp h

2条回答
  •  南笙
    南笙 (楼主)
    2021-02-07 22:45

    As of pandas 1.0.0 I believe you have another option, which is to first use convert_dtypes. This converts the dataframe columns to dtypes that support pd.NA, avoiding the issues with NaNs discussed in this answer.

提交回复
热议问题