I was wondering if someone could help me out with the following problem :
I'm given a .csv file which holds the information of wave height measurements from the past few years (2010 - 2016) (see image below)
Dominant wave heights:
Now the problem states that we compute the annual mean from the given time series with the use of a double loop, wherein the so called 'outer loop' will loop through the years of record and the 'inner loop' will loop through the data and add all the maximum wave heights for the year under consideration (while keeping track of the number of values for that year).
At this point I was able to create the dataframe from the .csv file with the use of read_csv and cancel out any unnecessary columns with the 'del'function:
df = read_csv('PR1_waves_triaxys_historical.csv', parse_dates=[0], delimiter=',', skipinitialspace=True)
Since I'm quite much new to python (and programming at all), I would really appreciate any form of help!
UPDATE: the dataframe is right now in the following form:
Time max_wave_height
0 2010-07-13 11:00:00 1.60
1 2010-07-13 12:00:00 1.41
2 2010-07-13 13:00:00 1.78
3 2010-07-13 14:00:00 1.98
4 2010-07-13 15:00:00 2.22
5 2010-07-13 16:00:00 1.96