Resampling pandas dataframe is deleting column

后端 未结 1 1831
隐瞒了意图╮
隐瞒了意图╮ 2020-12-11 16:50
                    Val         ts  year  doy     interpolat  region_id
2000-02-18          NaN  950832000  2000   49           NaN      19987
2000-03-05          Na         


        
相关标签:
1条回答
  • 2020-12-11 17:45

    The Val columns will probably not have a numerical dtype for some reason, and all non-numerical (eg object dtype) columns are removed in resample.

    To check, just look at df.info().
    To convert it to a numerical columns, you can use astype(float) or the convert_objects (pd.to_numeric starting from v0.17).

    0 讨论(0)
提交回复
热议问题