issues
1 row where repo = 13221727 and user = 7611856 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
943112510 | MDU6SXNzdWU5NDMxMTI1MTA= | 5598 | Conversion to pandas for zero-dimensional Data(Set|Array) | martinitus 7611856 | open | 0 | 2 | 2021-07-13T10:07:38Z | 2021-07-14T08:05:38Z | NONE | What happened:
Conversion to a pandas What you expected to happen:
I would expect it to return a trivial Minimal Complete Verifiable Example: ```python da = DataArray([1, 2, 3], dims=("x",), coords=dict(x=[1, 2, 3])) I don't know of a way to construct such data array without the isel.Essentially, below also works for higher dimensional data arrays andresults in a zero dimensional data array with all the coordinates ofthe found minimum.da = da.isel(**da.argmin(dim=("x",))) ds = Dataset({'a': da}) fails with ValueError: cannot convert a scalar to a DataFramefrom xarray/core/dataarray.py", line 2664, in to_dataframeda.to_dataframe(name="foo") Expected: a DataFrame with two columns (x and foo) and one rowfails with ValueError: no valid index for a 0-dimensional objectfrom xarray/core/coordinates.py", line 106, in to_indexds.to_dataframe() Expected: a DataFrame with two columns (x and a) and one row``` Anything else we need to know?: I tested a little bit and got what I want with simply removing the
block from
I that would be considered reasonable behavior I am happy to contribute the respective unit test and changes! Environment: Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.9.5 (default, May 19 2021, 11:32:47) [GCC 10.2.0] python-bits: 64 OS: Linux OS-release: 5.8.0-59-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.12.0 libnetcdf: 4.7.4 xarray: 0.17.0 pandas: 1.2.4 numpy: 1.20.2 scipy: 1.6.3 netCDF4: 1.5.6 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.4.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: 3.4.1 cartopy: None seaborn: None numbagg: None pint: None setuptools: 56.0.0 pip: 21.0.1 conda: None pytest: 6.2.3 IPython: 7.24.0 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5598/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
xarray 13221727 | issue |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issues] ( [id] INTEGER PRIMARY KEY, [node_id] TEXT, [number] INTEGER, [title] TEXT, [user] INTEGER REFERENCES [users]([id]), [state] TEXT, [locked] INTEGER, [assignee] INTEGER REFERENCES [users]([id]), [milestone] INTEGER REFERENCES [milestones]([id]), [comments] INTEGER, [created_at] TEXT, [updated_at] TEXT, [closed_at] TEXT, [author_association] TEXT, [active_lock_reason] TEXT, [draft] INTEGER, [pull_request] TEXT, [body] TEXT, [reactions] TEXT, [performed_via_github_app] TEXT, [state_reason] TEXT, [repo] INTEGER REFERENCES [repos]([id]), [type] TEXT ); CREATE INDEX [idx_issues_repo] ON [issues] ([repo]); CREATE INDEX [idx_issues_milestone] ON [issues] ([milestone]); CREATE INDEX [idx_issues_assignee] ON [issues] ([assignee]); CREATE INDEX [idx_issues_user] ON [issues] ([user]);