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

后端 未结 2 1533
小鲜肉
小鲜肉 2021-02-07 22:04

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:42

    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.

提交回复
热议问题