home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 930580130

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
930580130 MDU6SXNzdWU5MzA1ODAxMzA= 5538 Is to_dask_dataframe(set_index=...) correct? 5635139 closed 0     1 2021-06-26T00:56:04Z 2021-06-26T04:41:54Z 2021-06-26T04:41:54Z MEMBER      

What happened:

Calling ds.to_dask_dataframe(set_index='lat') raises on attempting to create a MultiIndex.

What you expected to happen:

Shouldn't this create a normal index with just lat?

Minimal Complete Verifiable Example:

```python In [1]: ds = xr.tutorial.load_dataset('air_temperature')

In [2]: ds.to_dask_dataframe(set_index='lat')

NotImplementedError Traceback (most recent call last) <ipython-input-2-e13a093182d0> in <module> ----> 1 ds.to_dask_dataframe(set_index='lat')

~/workspace/xarray/xarray/core/dataset.py in to_dask_dataframe(self, dim_order, set_index) 5534 # triggers an error about multi-indexes, even if only one 5535 # dimension is passed -> 5536 df = df.set_index(dim_order) 5537 5538 return df

~/.asdf/installs/python/3.8.10/lib/python3.8/site-packages/dask/dataframe/core.py in set_index(failed resolving arguments) 4177 from .shuffle import set_index 4178 -> 4179 return set_index( 4180 self, 4181 other,

~/.asdf/installs/python/3.8.10/lib/python3.8/site-packages/dask/dataframe/shuffle.py in set_index(df, index, npartitions, shuffle, compute, drop, upsample, divisions, partition_size, **kwargs) 140 index = index[0] 141 else: --> 142 raise NotImplementedError( 143 "Dask dataframe does not yet support multi-indexes.\n" 144 "You tried to index with this index: %s\n"

NotImplementedError: Dask dataframe does not yet support multi-indexes. You tried to index with this index: ['lat', 'time', 'lon'] Indexes must be single columns only. ```

Anything else we need to know?:

Environment:

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: 95ba539f660e696fc080f39dd0afc0e29385fabc python: 3.8.10 (default, May 9 2021, 13:21:55) [Clang 12.0.5 (clang-1205.0.22.9)] python-bits: 64 OS: Darwin OS-release: 20.4.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: None libnetcdf: None xarray: 0.18.2 pandas: 1.2.4 numpy: 1.20.3 scipy: 1.6.3 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: 2.8.3 cftime: 1.4.1 nc_time_axis: None PseudoNetCDF: None rasterio: 1.2.3 cfgrib: None iris: None bottleneck: 1.3.2 dask: 2021.06.1 distributed: 2021.06.1 matplotlib: 3.4.2 cartopy: None seaborn: 0.11.1 numbagg: 0.2.1 pint: None setuptools: 56.0.0 pip: 21.1.2 conda: None pytest: 6.2.4 IPython: 7.24.0 sphinx: 4.0.1
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5538/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 320.712ms · About: xarray-datasette