home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 864505158

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
864505158 MDU6SXNzdWU4NjQ1MDUxNTg= 5206 How can I apply Groupby function and still keep the chunks ? 21273359 closed 1     1 2021-04-22T03:33:12Z 2021-04-22T17:35:42Z 2021-04-22T17:35:41Z NONE      
  1. I have an 2-dims DataArray which be chunked along 1-dim I apply groupby operation on it, and it breaks out the chunks I expect it keeps the chunk, how can i process it correctly ?

  2. Code:

da = xr.DataArray(np.arange(120).reshape(24, 5), coords = {"x": range(24), "y":range(5)}, dims = ("x", "y")) da = da.chunk(chunks = {"x" : 5})

da show:

```

da xarray.DataArray x: 24y: 5 dask.array<chunksize=(5, 5), meta=np.ndarray> Coordinates: x (x) int64 0 1 2 3 4 5 6 ... 18 19 20 21 22 23 y (y) int64 0 1 2 3 4 Attributes: (0)

da.groupby("x").quantile(0.02, dim = "y") ``` Result:

xarray.DataArrayx: 24 dask.array<chunksize=(1,), meta=np.ndarray> Coordinates: quantile () float64 0.02 x (x) int64 0 1 2 3 4 5 6 ... 18 19 20 21 22 23 Attributes: (0)

  1. Version of xr:
Details INSTALLED VERSIONS ------------------ commit: None python: 3.7.8 | packaged by conda-forge | (default, Jul 31 2020, 02:25:08) [GCC 7.5.0] python-bits: 64 OS: Linux OS-release: 5.8.9-1.el7.elrepo.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.12.0 libnetcdf: 4.7.4 xarray: 0.17.0 pandas: 1.1.4 numpy: 1.19.1 scipy: 1.5.2 netCDF4: 1.5.6 pydap: None h5netcdf: None h5py: 3.2.1 Nio: None zarr: None cftime: 1.4.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.30.0 distributed: 2.30.1 matplotlib: 3.3.2 cartopy: None seaborn: 0.11.0 numbagg: None pint: None setuptools: 49.6.0.post20210108 pip: 21.0.1 conda: None pytest: 6.0.2 IPython: 7.22.0 sphinx: 3.2.1
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5206/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

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