Parsing string to datetime while accounting for AM/PM in pandas

后端 未结 2 1954
误落风尘
误落风尘 2021-01-19 10:48

I am trying to parse a string in this format \"2018 - 07 - 07 04 - AM\" to pandas datetime using strftime format. However, It seems to me the format doesn\'

2条回答
  •  深忆病人
    2021-01-19 11:13

    In my case, I got an error message when trying the proposed solutions:

     ValueError: unconverted data remains: PM
    

    This was solved by setting the locale to en_US.

提交回复
热议问题