0

I don't know why I am getting this again and again. here's is my code snippet.

enter image description here

my data have the date in MDY format, and time in H: M: S format.

FObersteiner
  • 22,500
  • 8
  • 42
  • 72
  • 1
    Well, with `09-01-2014 00:01`, you forgot the seconds. – MC Emperor Oct 11 '21 at 08:59
  • 1
    simply let pd.to_datetime infer the format, see e.g. [here](https://stackoverflow.com/a/69513938/10197418), or [here](https://stackoverflow.com/a/69513960/10197418) or [here](https://stackoverflow.com/a/69514937/10197418)... – FObersteiner Oct 11 '21 at 09:12

1 Answers1

0

The problem ist that you specify a format while your data contains two different formats: One with seconds (the last five values) and one without (the first five values). Your specified format doesn't fit both.

However, pandas can figure it out by itself if you don't specify the format:

work_data['Date/Time'] = pd.to_datetime(work_data['Date/Time'])
Hein Schnell
  • 322
  • 5
  • 15
  • data is of (4534327, 4) cells, it is taking a lot of time converting, even I left it for 30 mins to let to command work. but it is not working as it should. – Nehanshu Nirbhay Oct 12 '21 at 08:11