Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

datafram combine 3 columns to datetime

from datetime import datetime
df['date']= df.apply(lambda x:datetime.strptime("{0} {1} {2}".format(x['year'],x['month'], x['day']), "%Y %m %d"),axis=1)
df.index= df['date']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #datafram #combine #columns #datetime
ADD COMMENT
Topic
Name
6+5 =