Python Forum
Problem with date type (object to datetime)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with date type (object to datetime)
#1
Hi all,
so I have this issue with the convertion to date format.
here is how my csv file looks like:csv

and after setting headers and selecting some columns I got this: df

but when I want to convert to datetime64[ns] I got this error: error

Ialso tried this:
new_data['Date_Time']=pd.to_datetime(new_data['Date_Time'])
new_data.dtypes
but almost the same error:
~/anaconda3/lib/python3.7/site-packages/dateutil/parser/_parser.py in _build_naive(self, res, default)
   1225                 repl['day'] = monthrange(cyear, cmonth)[1]
   1226 
-> 1227         naive = default.replace(**repl)
   1228 
   1229         if res.weekday is not None and not res.day:

ValueError: year 1552231082 is out of range
Thks for your help.
B. regards
Karlito
Reply


Messages In This Thread
Problem with date type (object to datetime) - by karlito - Oct-15-2019, 12:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] Load date/time from .txt to 'datetime64' type. water 4 566 Mar-01-2024, 11:16 PM
Last Post: Gribouillis
  pymongo diff type problem to find images on two drives darter 0 1,285 Mar-11-2021, 04:52 AM
Last Post: darter
  replace nan values by mean group by date.year, date.month wissam1974 5 8,449 Feb-19-2020, 06:25 PM
Last Post: AnkitGupta
  Pandas and Date: problem with operator.How to resolve frame 6 4,349 May-13-2019, 05:50 PM
Last Post: frame
  TensorFlow problem in Object Detection yksingh1097 1 2,805 Oct-03-2018, 09:57 PM
Last Post: Larz60+
  Finding date count from a list of date range in pandas trillerducas72 0 2,747 May-24-2018, 02:30 AM
Last Post: trillerducas72

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020