I am using pandas to parse a CSV File. The CSV file contains a value for each day of the last 10 years.
The CSV looks like this:
production,day,year
5.0,50,2015
80.0,51,2015
190.0,52,2015
10.0,53,2015
.
.
.
2.0,50,2016
2.0,51,2016
40.0,52,2016
20.0,53,2016
.
.
i use the following code:
def calcAverageFirstYears(productionCSV):
myFile = pd.read_csv(productionCSV)
result = myFile[myFile['day']==52]
print(result)
So I get this reslut:
production day year
2 190.0 52.0 2015.0
9 40.0 52.0 2016.0
16 60.0 52.0 2017.0
23 6.0 52.0 2018.0
How can I calculte the average of these values? How can I calculte the average of the 2015 and 2016?
Thank you for your help