home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

1 row where user = 1034035 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date), closed_at (date)

type 1

  • issue 1

state 1

  • closed 1

repo 1

  • xarray 1
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
340316108 MDU6SXNzdWUzNDAzMTYxMDg= 2280 string coords are converted to object dtype when using MultiIndex / stacking ctw 1034035 closed 0     5 2018-07-11T16:26:12Z 2022-09-27T12:12:06Z 2022-09-27T12:12:05Z NONE      

Code Sample

```python import xarray as xr import pandas as pd

indx = pd.MultiIndex.from_arrays([['1', '2', '1', '2'], ['100', '100', '200', '200']], names=['a', 'b'])

MultiIndex(levels=[['1', '2'], ['100', '200']],

labels=[[0, 1, 0, 1], [0, 0, 1, 1]],

names=['a', 'b'])

tst = xr.DataArray(data=np.random.random((4)), coords=[('ab', indx)])

<xarray.DataArray (ab: 4)>

array([0.754308, 0.268363, 0.799407, 0.513185])

Coordinates:

* ab (ab) MultiIndex

- a (ab) object '1' '2' '1' '2'

- b (ab) object '100' '100' '200' '200'

tst2 = xr.DataArray(data=np.random.random((2,2)), coords=[('a', ['1', '2']), ('b', ['100', '200'])])

<xarray.DataArray (a: 2, b: 2)>

array([[0.854303, 0.179755],

[0.463453, 0.478913]])

Coordinates:

* a (a) <U1 '1' '2'

* b (b) <U3 '100' '200'

tst2.stack(ab=('a', 'b'))

<xarray.DataArray (ab: 4)>

array([0.854303, 0.179755, 0.463453, 0.478913])

Coordinates:

* ab (ab) MultiIndex

- a (ab) object '1' '1' '2' '2'

- b (ab) object '100' '200' '100' '200'

```

Problem description

The dtype for a and b in tst and tst2.stack() is object rather than some string dtype.

Expected Output

A string dtype for a and b.

Output of xr.show_versions()

# Paste the output here xr.show_versions() here INSTALLED VERSIONS ------------------ commit: None python: 3.6.5.final.0 python-bits: 64 OS: Linux OS-release: 4.15.0-24-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 xarray: 0.10.7 pandas: 0.23.1 numpy: 1.14.5 scipy: 1.1.0 netCDF4: 1.4.0 h5netcdf: 0.6.1 h5py: 2.8.0 Nio: None zarr: None bottleneck: 1.2.1 cyordereddict: None dask: 0.18.1 distributed: 1.22.0 matplotlib: 2.2.2 cartopy: None seaborn: 0.8.1 setuptools: 39.2.0 pip: 9.0.3 conda: 4.5.5 pytest: 3.6.2 IPython: 6.4.0 sphinx: 1.7.5
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2280/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 145.294ms · About: xarray-datasette