def count(data, axis=None):
    """Count the number of non-NA in this array along the given axis or axes"""
    xp = get_array_namespace(data)
    return xp.sum(xp.logical_not(isnull(data)), axis=axis)
Count the number of non-NA in this array along the given axis or axes
xarray/core/duck_array_ops.py