Looking at my example below, I want to resample my data to be hourly. I want to average the 'temperature' data over the hour and sum the 'rainfall data over the hour.
Snippet: F = F.csv
So far, my code that works, says:
F = F.resample('h').agg({'temperature':np.mean,'rainfall': np.sum})
But this code is very inefficient because I have over 100 columns to resample differently.
So if I create another csv, example below: G = G.csv
Does anyone have any suggestions on how to code:
When F.column = G.column, resample F.column based on G.row('resample')
Any help would be greatly appreciated.
Aucun commentaire:
Enregistrer un commentaire