I have a pandas dataframe:
import numpy as np
import pandas as pd
idx = pd.DataFrame(["2017-01-01 00:00:41","2017-01-01 00:06:53",\
"2017-01-01 00:07:10"],columns=["DateTime"])
df = pd.DataFrame([221,676,356],columns=["Value"])
df.index = pd.DatetimeIndex(idx["DateTime"])
df
which produces something like
DateTime Value
2017-01-01 00:13:41 221
2017-01-02 00:06:53 676
2017-01-05 00:22:10 356
What I would like to do next is remove the year and month information from this DateTime index, so as to produce
DateTime Value
01 00:13:41 221
02 00:06:53 676
05 00:22:10 356
I know that in the DataFrame idx I can drop it as follows:
idx["DateTime"] = idx["DateTime"].str(8:)
The problem is that this is no longer recognised by pandas as a DatetimeIndex. Moreover plotting this becomes very tricky (something I'd like to do subsequently). Any ideas how I can achieve this? (I'm sure it can be done, Python/pandas are too versatile not to have some cunning trick for achieving it!)