home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 974488736

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
974488736 MDU6SXNzdWU5NzQ0ODg3MzY= 5715 Dask error on xarray.corr 9466648 closed 0     5 2021-08-19T09:59:28Z 2021-11-24T17:25:24Z 2021-11-24T17:25:24Z CONTRIBUTOR      

What happened: When I use xarray.corr on two Dataarrays I get a NameError: name 'dask' is not defined error. Notice that dask is not installed in my environement.

What you expected to happen: Obtain the correlation values without dask interfering (as it should be optional in my understanding)

Minimal Complete Verifiable Example: python N = 100 ds = xr.Dataset( data_vars={ 'x': ('t', np.random.randn(N)), 'y': ('t', np.random.randn(N)) }, coords={ 't': range(N) } ) xr.corr(ds['y'], ds['x']) Results in: ```


NameError Traceback (most recent call last) /tmp/ipykernel_732567/1992585666.py in <module> ----> 1 xr.corr(ds['y'], ds['x'])

~/.local/share/virtualenvs/e-sport-ml-IJ_mJ64l/lib/python3.8/site-packages/xarray/core/computation.py in corr(da_a, da_b, dim) 1343 ) 1344 -> 1345 return _cov_corr(da_a, da_b, dim=dim, method="corr") 1346 1347

~/.local/share/virtualenvs/e-sport-ml-IJ_mJ64l/lib/python3.8/site-packages/xarray/core/computation.py in _cov_corr(da_a, da_b, dim, ddof, method) 1371 return da 1372 -> 1373 da_a = da_a.map_blocks(_get_valid_values, args=[da_b]) 1374 da_b = da_b.map_blocks(_get_valid_values, args=[da_a]) 1375

~/.local/share/virtualenvs/e-sport-ml-IJ_mJ64l/lib/python3.8/site-packages/xarray/core/dataarray.py in map_blocks(self, func, args, kwargs, template) 3811 from .parallel import map_blocks 3812 -> 3813 return map_blocks(func, self, args, kwargs, template) 3814 3815 def polyfit(

~/.local/share/virtualenvs/e-sport-ml-IJ_mJ64l/lib/python3.8/site-packages/xarray/core/parallel.py in map_blocks(func, obj, args, kwargs, template) 332 ) 333 --> 334 if not dask.is_dask_collection(obj): 335 return func(obj, args, *kwargs) 336

NameError: name 'dask' is not defined ```

Environment:

``` INSTALLED VERSIONS


commit: None python: 3.8.6 (default, Dec 16 2020, 11:33:05) [GCC 10.2.0] python-bits: 64 OS: Linux OS-release: 5.13.6-arch1-1 machine: x86_64 processor: byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: 1.12.0 libnetcdf: None

xarray: 0.19.0 pandas: 1.3.1 numpy: 1.21.1 scipy: 1.7.1 netCDF4: None pydap: None h5netcdf: None h5py: 3.3.0 Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: 3.4.2 cartopy: None seaborn: 0.11.1 numbagg: None pint: None setuptools: 51.0.0 pip: 20.3.1 conda: None pytest: None IPython: 7.26.0 sphinx: None ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5715/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

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