Converting pandas.tslib.Timestamp to datetime python

后端 未结 9 1156
予麋鹿
予麋鹿 2020-12-05 17:36

I have a df time series. I extracted the indexes and want to convert them each to datetime. How do you go about doing that? I tried to use pa

9条回答
  •  猫巷女王i
    2020-12-05 17:48

    import time
    time.strftime("%H:%M",  time.strptime(str(x), "%Y-%m-%d %H:%M:%S"))
    

    Note: x should be pandas.tslib.Timestamp (as it is in the question)

提交回复
热议问题