home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 576512167

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
576512167 MDU6SXNzdWU1NzY1MTIxNjc= 3835 3D DataArray.to_pandas() fails with a bad message 5635139 closed 0     1 2020-03-05T20:30:06Z 2020-03-20T17:14:41Z 2020-03-20T17:14:41Z MEMBER      

Panel is removed from pandas (as a result of the success of xarray! :grin: ), but we're still attempting to call it from .to_pandas()

MCVE Code Sample

```python

Your code here

In [4]: import numpy as np

In [1]: import xarray as xr
In [5]: xr.DataArray(np.random.rand(2,3,4)).to_pandas()


TypeError Traceback (most recent call last) <ipython-input-5-7d1b667d5cac> in <module> ----> 1 xr.DataArray(np.random.rand(2,3,4)).to_pandas()

~/workspace/corpfin/.venv/lib64/python3.6/site-packages/xarray/core/dataarray.py in to_pandas(self) 2267 ) 2268 indexes = [self.get_index(dim) for dim in self.dims] -> 2269 return constructor(self.values, *indexes) 2270 2271 def to_dataframe(self, name: Hashable = None) -> pd.DataFrame:

TypeError: object() takes no parameters

```

Expected Output

Either a MultiIndexed DataFrame or a proper error (4D gives ValueError: cannot convert arrays with 4 dimensions into pandas objects)

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 21:52:21) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: ... machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.utf8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.1 xarray: 0.15.0 pandas: 1.0.1 numpy: 1.17.3 scipy: 1.3.2 netCDF4: 1.5.3 pydap: None h5netcdf: 0.7.4 h5py: 2.10.0 Nio: None zarr: None cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.2.1 dask: 2.7.0 distributed: 2.7.0 matplotlib: 3.1.2 cartopy: None seaborn: 0.9.0 numbagg: installed setuptools: 41.6.0.post20191101 pip: 19.3.1 conda: None pytest: 5.2.2 IPython: 7.9.0 sphinx: 2.2.1
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3835/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
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 79.668ms · About: xarray-datasette