home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 208676242

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
208676242 MDU6SXNzdWUyMDg2NzYyNDI= 1276 DataArray doesnt use bottleneck implementation on rolling variance 11671536 closed 0     2 2017-02-18T22:22:16Z 2017-03-06T01:32:14Z 2017-03-06T01:32:14Z NONE      

It appears that the DataArray is not using the bottleneck move_var when calling var on a rolling object but it does for std. I have attached some simple benchmarks to demonstrate.

python version 3.6 pandas version 0.19.2 xarray version 0.9.1 bottleneck version 1.2.0

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

data = np.random.rand(10000)

xarray setup

ar = xr.DataArray(data, dims=['time']) xrol = ar.rolling(time=30)

pandas setup

df = ar.to_pandas() prol = df.rolling(30) ```

```python

xray std profile

%time _ = xrol.std() ```

CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 209 µs

```python

xray var profile

%time _ = xrol.var() ```

CPU times: user 8.69 s, sys: 132 ms, total: 8.82 s
Wall time: 8.52 s

```python

pandas std profile

%time _ = prol.std() ```

CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 1.13 ms

```python

pandas var profile

%time _ = prol.var() ```

CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 617 µs

```python

bottleneck std profile

%time _ = bottleneck.move_std(data, 30) ```

CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 138 µs

```python

bottleneck var profile

%time _ = bottleneck.move_var(data, 30) ```

CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 143 µs
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1276/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
  • 2 rows from issue in issue_comments
Powered by Datasette · Queries took 81.186ms · About: xarray-datasette