home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1692597701

This data as json

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
1692597701 I_kwDOAMm_X85k4v3F 7808 Default behaviour of `min_count` wrong with flox 2448579 closed 0     0 2023-05-02T15:04:11Z 2023-05-10T02:39:45Z 2023-05-10T02:39:45Z MEMBER      

What happened?

```python with xr.set_options(display_style="text", use_flox=False): with xr.set_options(use_flox=False): display( xr.DataArray( data=np.array([np.nan, 1, 1, np.nan, 1, 1]), dims="x", coords={"labels": ("x", np.array([1, 2, 3, 1, 2, 3]))}, ) .groupby("labels") .sum() )

with xr.set_options(use_flox=True):
    display(
        xr.DataArray(
            data=np.array([np.nan, 1, 1, np.nan, 1, 1]),
            dims="x",
            coords={"labels": ("x", np.array([1, 2, 3, 1, 2, 3]))},
        )
        .groupby("labels")
        .sum()
    )

```

```

without flox

<xarray.DataArray (labels: 3)> array([0., 2., 2.]) Coordinates: * labels (labels) int64 1 2 3

with flox

<xarray.DataArray (labels: 3)> array([nan, 2., 2.]) Coordinates: * labels (labels) int64 1 2 3 ```

What did you expect to happen?

The same answer. We should set min_count=0 when min_count is None

Minimal Complete Verifiable Example

No response

MVCE confirmation

  • [ ] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [ ] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [ ] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [ ] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

No response

Environment

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7808/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 0.526ms · About: xarray-datasette