home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1126083413

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/issues/659#issuecomment-1126083413 https://api.github.com/repos/pydata/xarray/issues/659 1126083413 IC_kwDOAMm_X85DHqtV 13301940 2022-05-13T13:55:20Z 2022-05-13T13:55:20Z MEMBER

5734 has greatly improved the performance. Fantastic work @dcherian 👏🏽

```python In [13]: import xarray as xr, pandas as pd, numpy as np

In [14]: ds = xr.Dataset({"a": xr.DataArray(np.r_[np.arange(500.), np.arange(500.)]), ...: "b": xr.DataArray(np.arange(1000.))})

In [15]: ds Out[15]: <xarray.Dataset> Dimensions: (dim_0: 1000) Dimensions without coordinates: dim_0 Data variables: a (dim_0) float64 0.0 1.0 2.0 3.0 4.0 ... 496.0 497.0 498.0 499.0 b (dim_0) float64 0.0 1.0 2.0 3.0 4.0 ... 996.0 997.0 998.0 999.0 ```

```python In [16]: xr.set_options(use_flox=True) Out[16]: <xarray.core.options.set_options at 0x104de21a0>

In [17]: %%timeit ...: ds.groupby("a").mean() ...: ...: 1.5 ms ± 3.3 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)

In [18]: xr.set_options(use_flox=False) Out[18]: <xarray.core.options.set_options at 0x144382350>

In [19]: %%timeit ...: ds.groupby("a").mean() ...: ...: 94 ms ± 715 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) ```

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