Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas remove time from datetime

In [37]:

df = pd.DataFrame({'date':['2015-02-21 12:08:51']})
df
Out[37]:
                  date
0  2015-02-21 12:08:51
In [39]:

df['date'] = pd.to_datetime(df['date']).dt.date
df
Out[39]:
         date
0  2015-02-21
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #remove #time #datetime
ADD COMMENT
Topic
Name
1+5 =