I have 36 data frames that each contain columns titled "lon", "lat", and "bottom_temp". Each different data frame represents data from a year between 1980 and 2015. I have a seperate dataframe called "month3_avg_box" that contains two columns: "year" and "avg_bottom_temp". The year column of the "month3_avg_box" data frame contains one row for each year between 1980-2015. I would like to find the average value of each "bottom_temp" column in each of the 36 data frames I have, and place each mean in the corresponding row of the new "month3_avg_box" data frame I have. I will write a mini example of what I'd like:
1980_df:
lon lat bottom_temp
-75.61 39.1 11.6
-75.60 39.1 11.5
-75.59 39.1 11.6
-75.58 39.1 11.7
(mean of bottom_temp column for 1980_df = 11.6)
1981_df:
lon lat bottom_temp
-75.57 39.1 11.9
-75.56 39.1 11.9
-75.55 39.1 12.0
-75.54 39.1 11.8
(mean of bottom_temp column for 1981_df = 11.9)
1982_df:
lon lat bottom_temp
-75.57 39.1 11.6
-75.56 39.1 11.7
-75.55 39.1 11.9
-75.54 39.1 11.2
(mean of bottom_temp column for 1982_df = 11.6)
Now, I'd like to take these averages and put them into my "month3_avg_box" data frame so it looks like:
month3_avg_box:
Year Avg_bottom_temp
1980 11.6
1981 11.9
1982 11.6
Does this make sense? How can I do this?