Replace the missing values in the variable "s_months" and "incidents" by the respective means of the other ships that share the same type AND the same operation period. Here "s_months" and "incidents" are two columns, having nan values, which we want to fill.
I have tried to find means according to asked conditions. But unable to fill nan values in ship data frame. Here are means calculated, and stored as a data frame.

