id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 1841586869,PR_kwDOAMm_X85XcrvT,8057,Count documentation,90768774,closed,0,,,5,2023-08-08T15:59:03Z,2023-08-09T13:50:58Z,2023-08-09T13:50:54Z,CONTRIBUTOR,,0,pydata/xarray/pulls/8057," - [x] Closes #8055 - [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst` I've changed the example to include a 0 value which clearly shows that only NA values are ignored in the count. I've only modified the ""see also"" section for `count` since as mentioned in #8055 it is a bit of an outlier among the aggregation methods. I believe that this is not a long term fix since the single line summary of the method is of little use, but at least with this no one will have to take a look at the source code to quickly get what `count` does. Feel free to correct any problems or suggest any changes, as I am quite new to contributing to projects like this and have little idea of what I'm doing :sweat_smile: ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8057/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 1841227199,I_kwDOAMm_X85tvuW_,8055,Documentation of `Dataset.count()` is ambiguous,90768774,closed,0,,,3,2023-08-08T12:35:59Z,2023-08-09T13:50:56Z,2023-08-09T13:50:56Z,CONTRIBUTOR,,,,"### 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](https://docs.xarray.dev/en/latest/generated/xarray.DataArray.count.html#xarray.DataArray.count) 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...","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8055/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue