I am having pandas dataframe with datetime index. I am trying to normalize it to midnight. https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.dt.normalize.html What I get is the following
print('before')
print(df.head())
df.index=df.index.normalize()
print('after')
print(df.head())
before
cabin hx
2000-01-01 00:20:51 21.1 19.1
2000-01-01 00:21:01 21.1 19.1
2000-01-01 00:21:11 21.1 19.2
2000-01-01 00:21:21 21.1 19.1
2000-01-01 00:21:31 21.1 17.9
after
cabin hx
2000-01-01 21.1 19.1
2000-01-01 21.1 19.1
2000-01-01 21.1 19.2
2000-01-01 21.1 19.1
2000-01-01 21.1 17.9
So hour, min and sec are dropped away. Help appreciated.