sh1ng sh1ng - 1 year ago 137
Python Question

python pandas parse datetime string with months names

Can someone point me to a format or a code snippet to parse date in format like


doesn't work.

Answer Source

Use format string: '%d%b%y:%H:%M:%S' and pass this as the format for to_datetime, you can find the format options in the docs:

In [73]:

pd.to_datetime('04SEP12:00:00:00', format='%d%b%y:%H:%M:%S')
Timestamp('2012-09-04 00:00:00')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download