Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

pandas – ParserError: Unknown string format: Timestamp

I have date strings that’s generated using unix milliseconds.

This is how the date string looks like.

2020-01-01 00:04:59.999.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I saved the data into a csv file.

I’m loading the data using pd.read_csv and then I’m trying to parse the date like this.

df = pd.read_csv('data.csv')
df["Timestamp"] = pd.to_datetime(df["Timestamp"])

However, I’m getting the following error:

ParserError: Unknown string format: Timestamp

Can someone tell me how to fix the error?

>Solution :

It means that you have a Timestamp word instead of one of the dates

For example:

Timestamp, 3 
Timestamp, 3
2020-01-01 00:04:59.999, 3

Try to open your csv in any editor and search for Timestamp

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading