Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas change to first day

df['day'] = df['day'].map(lambda x: pd.datetime(x.year, x.month, 1))
print (df)
         day
0 2016-07-01
1 2016-08-01
2 2016-09-01
3 2016-10-01
4 2016-11-01
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #change #day
ADD COMMENT
Topic
Name
9+3 =