Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pandas column to date

df = pd.DataFrame({'date':['31DEC2002','31 December 2015 00:00:00.000 GMT','.']})

df['date'] = pd.to_datetime(df['date'], utc=True, errors='coerce')
print (df)
                       date
0 2002-12-31 00:00:00+00:00
1 2015-12-31 00:00:00+00:00
2                       NaT
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #pandas #column #date
ADD COMMENT
Topic
Name
4+9 =