Hi all,

I have a dataframe with rows as dates and columns as data points. I need to calculate the mean of each column, but the problem is that some of the columns have “NaN” values.

Is there an efficient way to achieve this by ignoring the NaN values for each calculation? (meaning if one column has 4 values but one is NaN, then the mean will only include 3 values in the calculation).

It sounds like a simple problem but I couldn’t find a solution yet.

Thank you!