def _nanmean(a, axis=None):
 if axis:
  return (np.nansum(a, axis) / np.sum((1 - np.isnan(a)), axis))
 else:
  return (np.nansum(a) / np.sum((1 - np.isnan(a))))

def _nanmean ( a , axis = None ) : if axis : return ( np . nansum ( a , axis ) / np . sum ( ( 1 - np . isnan ( a ) ) , axis ) ) else : return ( np . nansum ( a ) / np . sum ( ( 1 - np . isnan ( a ) ) ) )
return the mean excluding items that are nan .