I have a timeseries of half hourly electricity data that looks like this:
Date_Time Metered Electricity (MWh)
0 2016-03-27 00:00:00 8.644511
1 2016-03-27 00:30:00 6.808402
2 2016-03-27 01:00:00 6.507068
3 2016-03-27 01:30:00 5.271631
4 2016-03-27 02:00:00 2.313497
... ... ...
58122 2019-06-30 11:30:00 8.051935
58123 2019-06-30 12:00:00 3.520226
58124 2019-06-30 12:30:00 5.093964
I want to average all of the data points into an average for each half hourly timestep, ultimately so I can create a graph showing the average electricity produced throughout the day.
I've managed to do this for the hourly data using groupby which works fine:
mean_hourly = energy_2018.groupby(energy_2018["Date_Time"].dt.hour).mean()
which I can use if I can't work out how to do groupby half hourly, but it would mean I am missing out on half of all the data. Any idea how to use groupby half hourly so I can use all of the data?
Thank you!