home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

2 rows where state = "open", type = "issue" and user = 1778852 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 1

  • issue · 2 ✖

state 1

  • open · 2 ✖

repo 1

  • xarray 2
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
326344778 MDU6SXNzdWUzMjYzNDQ3Nzg= 2183 converting int vars to floats when I where the enclosing ds? IvoCrnkovic 1778852 open 0     5 2018-05-25T00:48:43Z 2022-04-09T02:14:23Z   NONE      

Code Sample

```python test_ds = xr.Dataset()

test_ds['var1'] = xr.DataArray(np.arange(5)) test_ds['var2'] = xr.DataArray(np.ones(5))

assert(test_ds['var1'].dtype == np.int64)

assert(test_ds.where(test_ds['var2'] == 1)['var1'].dtype == np.int64) ```

Problem description

Second assert fails, which is a bit strange I think. Is that intended? If so, whats the reasoning?

Output of xr.show_versions()

commit: None python: 2.7.14.final.0 python-bits: 64 OS: Linux OS-release: 4.9.87-linuxkit-aufs machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_US.UTF-8 LANG: None LOCALE: None.None xarray: 0.10.3 pandas: 0.22.0 numpy: 1.14.3 scipy: 1.1.0 netCDF4: None h5netcdf: None h5py: None Nio: None zarr: None bottleneck: 1.2.1 cyordereddict: None dask: None distributed: None matplotlib: 2.2.2 cartopy: None seaborn: 0.8.1 setuptools: 39.1.0 pip: 10.0.1 conda: None pytest: 3.5.1 IPython: 5.6.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2183/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
484699415 MDU6SXNzdWU0ODQ2OTk0MTU= 3256 .item() on a DataArray with dtype='datetime64[ns]' returns int IvoCrnkovic 1778852 open 0     4 2019-08-23T20:29:50Z 2022-04-09T02:03:43Z   NONE      

MCVE Code Sample

```python import datetime import xarray as xr

test_da = xr.DataArray(datetime.datetime(2019, 1, 1, 1, 1))

test_da

<xarray.DataArray ()>

array('2019-01-01T01:01:00.000000000', dtype='datetime64[ns]')

test_da.item()

1546304460000000000

```

Expected Output

I would think it would be nice to get a datetime out of the .item() call then the nanosecond representation.

Output of xr.show_versions()

When I call xr.show_versions() i get an error but im running xarray 0.12.3
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3256/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

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 21.251ms · About: xarray-datasette