home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1257220735

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/7048#issuecomment-1257220735 https://api.github.com/repos/pydata/xarray/issues/7048 1257220735 IC_kwDOAMm_X85K76p_ 43316012 2022-09-25T15:42:49Z 2022-09-25T15:42:49Z COLLABORATOR

```python import numpy as np import pandas as pd import xarray as xr

da = xr.DataArray( np.array([1, 2, 3, 1, 2, np.nan]), dims="time", coords=dict( time=("time", pd.date_range("01-01-2001", freq="M", periods=6)), labels=("time", np.array(["a", "b", "c", "c", "b", "a"])), ), ) da.groupby("labels").count()

da = xr.DataArray( np.array([1, 2, 3, 1, 2, np.nan]), dims="time", coords=dict( time=("time", pd.date_range("01-01-2001", freq="M", periods=6)), labels=("time", np.array(["a", "b", "c", "c", "b", "a"])), ), ) da.groupby("labels").count() ```

For me this works in a python terminal, python script and jupyter notebook (I don't use spyder but vscode).

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  1376479521
Powered by Datasette · Queries took 0.802ms · About: xarray-datasette