Skip to content

Documentation of Dataset.count() is ambiguous #8055

Closed
@Articoking

Description

@Articoking

What is your issue?

Hello everyone!

I've noticed that the documentation for Dataset.count and DataArray.count is a little unclear with respect to what it actually does. In my experience, it's not immediately obvious when looking at this site whether zero values are counted or not.

The given example does not contain a 0 value that would clarify this, and what is worse is that the "see also" section points to np.count and to dask.array.count which do not exist. The closest NumPy equivalent is np.count_nonzero, which has a different behavior to the xarray count method. The xarray count is actually equivalent to Pandas DataFrame.count, which count all non-NA values including 0.

I would take a shot at writing a clearer docstring but I'm not sure how to do that using the generate_aggregations.py file...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions