Using the to_datetime function I am getting the dates as well as the time when i am print it out. I only need the dates. Is there any method to remove it while converting?
pd.to_datetime(pd.Series(dates))
- 0 2013-12-20 00:00:00
- 1 2013-12-21 00:00:00
- 2 2013-12-22 00:00:00
- 3 2013-12-23 00:00:00
the code:(My data don't have time in it but its printing the time. Also I would like to add that its printing time while I am printing it after doing groupby on it)
data = pd.read_csv('workingfile.csv')
data['WEEK'] = pd.to_datetime(data['WEEK'],dayfirst = True)
grouped = data.groupby(['UPC','WEEK'])
for (upc,week), group in grouped:
print week
WEEK
02/06/2013 00:00
09/06/2013 00:00
16/06/2013 00:00
23/06/2013 00:00
30/06/2013 00:00
07/07/2013 00:00
14/07/2013 00:00