I have a pandas dataframe data with three frequencies (in some data there are even more)
Date value frequency
23/10/2016 20:31 0 00:06
23/10/2016 20:36 0.5 00:05
23/10/2016 20:43 0.2 00:07
23/10/2016 20:49 0.1 00:06
23/10/2016 20:54 0 00:05
23/10/2016 21:00 2 00:06
23/10/2016 21:06 4 00:06
23/10/2016 21:12 5 00:06
23/10/2016 21:18 6 00:06
23/10/2016 21:24 10 00:06
23/10/2016 21:31 0 00:07
23/10/2016 21:37 0 00:06
23/10/2016 21:43 0 00:06
23/10/2016 21:48 7 00:05
23/10/2016 21:55 10 00:07
23/10/2016 22:00 0 00:05
23/10/2016 22:06 0 00:06
23/10/2016 22:12 0 00:06
23/10/2016 22:18 0 00:06
23/10/2016 22:25 0 00:07
23/10/2016 22:31 0 00:06
What I want of this data is I want to re sample to 15 mins, is there a way that panda handle multiple frequency data while creating index and that can be used for re-sampling the data.
I tried like this :
df=my_data_frame
df.index=df['Date']
df.resample('15T').sum()
This is giving me weird result like this :
Date value
10/01/2016 22:15 0
10/01/2016 22:30 0
10/01/2016 22:45 0
10/01/2016 23:00 0
10/01/2016 23:15 0
10/01/2016 23:30 0
10/01/2016 23:45 0
11/01/2016 0:00
11/01/2016 0:15
11/01/2016 0:30
11/01/2016 0:45
11/01/2016 1:00
11/01/2016 1:15
11/01/2016 1:30
11/01/2016 1:45
11/01/2016 2:00
11/01/2016 2:15
11/01/2016 2:30
11/01/2016 2:45
11/01/2016 3:00
Index has been changed... ?
df.head().to_dict()here?