Python Forum

Full Version: dataframe column mean skip na
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I have below dataframe:
df:
  c1 c2 c3
A 1  0  0
B    na 1 
C 1  1  1
I use below code:
df.mean(axis = 1, skipna = True)
but I am getting NaN.
my desired output:
c1 c2  c3
1   0.5 0.66