I have a data set about femicides in Brazil. The columns are state, type_of_crime, year, quantity deaths_100K_pop. There are some missing values in quantity and I want to fill these with the mean of the columns quantity but I should do that regarding each year. I dont know exactly how to do it, what way is more eficient. I would like some help, but not the entire solution. Thanks.
I though about using groupby in years and discovering each average per year and then filling the missing values. I though about for loops as well.