I have this dataframe, sales and the column, dates.
When I try to see the range of dates, it shows me them like this. It shows the last date, 31.10.2015, somewhere in the middle instead of the end of this array.
In: sales.date.unique()
Out: array(['01.01.2013', '01.01.2014', '01.01.2015', ..., '31.10.2015',
'31.12.2013', '31.12.2014'], dtype=object)
when I have tried to sort these dates with
sales.date.sort_values(), it still gives me '31.12.2014' as the last date.
then, I converted my dates to datetime64[ns] with
sales["date"] = pd.to_datetime(sales["date"],format = "%d.%m.%Y")
sales["date"] = pd.to_datetime(sales["date"],format = "%d.%m.%Y")
dates = sales.date.sort_values()
dates.unique()
I got this format
array(['2013-01-01T00:00:00.000000000', '2013-01-02T00:00:00.000000000',
'2013-01-03T00:00:00.000000000', ...,
'2015-10-29T00:00:00.000000000', '2015-10-30T00:00:00.000000000',
'2015-10-31T00:00:00.000000000'], dtype='datetime64[ns]')
How can I remove the 'T00:00:00.000000000' part? I have specified format = "%d.%m.%Y" in pd_todatetime..
sorry if that's somewhat a basic question. thank you for your help.