The ability to group data is one of the essential features for pandas' dataframes. In the solar cell example, you saw that we had a data frequency of one measurement per minute. What if you want to report on an hourly or daily basis instead? We just form groups and aggregate the data in a prescribed way.
The following example forms a new dataframe with the two columns labeled Watt and SEK reporting the peak solar cell power per day and the average price in SEK:
solar_day=solar_all.groupby(solar_all.index.date).agg({'Watt':'max',
'SEK':'mean'})
Again, we can visualize the results by using the dataframe method plot:
solar_day.index=pd.to_datetime(solar_day.index,format='%Y-%m-%d')
ax=solar_day.loc['2020-06-01':'2020-06-30'].plot.bar('Watt')
Note, we created an axis object, ax, in order to change the tick labels on the ...