convert a SAS datetime in Pandas

后端 未结 2 1531
自闭症患者
自闭症患者 2020-12-17 02:53

I am using Pandas to read a Sas dataset using read_sas

There is a datetime variable in the SAS dataset, which appears

2条回答
  •  猫巷女王i
    2020-12-17 03:35

    You will get the right date in Python by using format='sas7bdat' option in your read_sas() method. For example, I used: pd.read_sas(dataset, format='sas7bdat'), and the dates got translated correctly to python dataframe.

提交回复
热议问题