def nannumel(x, **kwargs):
 return chunk.sum((~ np.isnan(x)), **kwargs)

def nannumel ( x , ** kwargs ) : return chunk . sum ( ( ~ np . isnan ( x ) ) , ** kwargs )
a reduction to count the number of elements .