Closed
Description
Currently normalize
does not work on a Series
or a DataFrame
:
pd.Series(range(5), index=pd.date_range('2013-1-1', periods=5,freq='D')).normalize()
AttributeError: 'Series' object has no attribute 'normalize'
However, changing the timezone, which I consider to be a similar type of operation, does work:
In [50]: pd.Series(range(5), index=pd.date_range('2013-1-1', periods=5,freq='D')).tz_localize('America/New_York')
Out[50]:
2013-01-01 00:00:00-05:00 0
2013-01-02 00:00:00-05:00 1
2013-01-03 00:00:00-05:00 2
2013-01-04 00:00:00-05:00 3
2013-01-05 00:00:00-05:00 4
Freq: D, dtype: int64
My current workaround:
s = pd.Series(range(5), index=pd.date_range('2013-1-1', periods=5,freq='D'))
s.index = s.index.normalize()