home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

3 rows where comments = 5, type = "issue" and user = 1200058 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)

state 2

  • open 2
  • closed 1

type 1

  • issue · 3 ✖

repo 1

  • xarray 3
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
712217045 MDU6SXNzdWU3MTIyMTcwNDU= 4476 Reimplement GroupBy.argmax Hoeze 1200058 open 0     5 2020-09-30T19:25:22Z 2023-03-03T06:59:40Z   NONE      

Please implement

Is your feature request related to a problem? Please describe. Observed: python da.groupby("g").argmax(dim="t") ```python


AttributeError Traceback (most recent call last) <ipython-input-84-15c199b0f7d4> in <module> ----> 1 da.groupby("g").argmax(dim="t")

AttributeError: 'DataArrayGroupBy' object has no attribute 'argmax' ```

Describe the solution you'd like Expected: Vector of length len(unique(g)) containing the indices of da["t"] where the value was maximum.

Workaround: python da.groupby("g").apply(lambda c: c.argmax(dim="t")) <xarray.DataArray 'da' (st: 11, g: 1)> array([[ 7], [ 0], [14], [14], [ 0], [ 0], [ 7], [ 0], [14], [ 0], [ 7]]) Coordinates: * st (st) object 'a' ... 'z' * g (g) object 'E'

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4476/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
510844652 MDU6SXNzdWU1MTA4NDQ2NTI= 3432 Scalar slice of MultiIndex is turned to tuples Hoeze 1200058 closed 0     5 2019-10-22T18:55:52Z 2022-03-17T17:11:41Z 2022-03-17T17:11:41Z NONE      

Today I updated to v0.14 of xarray and it broke some of my code.

I tried to select one observation of the following dataset: <xarray.Dataset> Dimensions: (genes: 31523, observations: 236) Coordinates: * genes (genes) object 'ENSG00000227232' ... 'ENSG00000232254' * observations (observations) MultiIndex - individual (observations) object 'GTEX-111YS' ... 'GTEX-ZXG5' - subtissue (observations) object 'Whole_Blood' ... 'Whole_Blood' Data variables: [...] ds.isel(observations=1): <xarray.Dataset> Dimensions: (genes: 31523) Coordinates: * genes (genes) object 'ENSG00000227232' ... 'ENSG00000232254' observations object ('GTEX-1122O', 'Whole_Blood') Data variables: [...]

As you can see, observations is now a tuple of ('GTEX-1122O', 'Whole_Blood'). However, the individual and the subtissue should be kept as coordinates.

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.7.4 (default, Aug 13 2019, 20:35:49) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 3.10.0-514.16.1.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.4 libnetcdf: 4.6.1 xarray: 0.14.0 pandas: 0.25.1 numpy: 1.17.2 scipy: 1.3.1 netCDF4: 1.4.2 pydap: None h5netcdf: 0.7.4 h5py: 2.9.0 Nio: None zarr: 2.3.2 cftime: 1.0.3.4 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.5.2 distributed: 2.5.2 matplotlib: 3.1.1 cartopy: None seaborn: 0.9.0 numbagg: None setuptools: 41.4.0 pip: 19.2.3 conda: None pytest: 5.0.1 IPython: 7.8.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3432/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed xarray 13221727 issue
528060435 MDU6SXNzdWU1MjgwNjA0MzU= 3570 fillna on dataset converts all variables to float Hoeze 1200058 open 0     5 2019-11-25T12:39:49Z 2020-09-15T15:35:04Z   NONE      

MCVE Code Sample

python xr.Dataset( { "A": ("x", [np.nan, 2, np.nan, 0]), "B": ("x", [3, 4, np.nan, 1]), "C": ("x", [True, True, False, False]), "D": ("x", [np.nan, 3, np.nan, 4]) }, coords={"x": [0, 1, 2, 3]} ).fillna(value={"A": 0}) <xarray.Dataset> Dimensions: (x: 4) Coordinates: * x (x) int64 0 1 2 3 Data variables: A (x) float64 0.0 2.0 0.0 0.0 B (x) float64 3.0 4.0 nan 1.0 C (x) float64 1.0 1.0 0.0 0.0 D (x) float64 nan 3.0 nan 4.0

Expected Output

<xarray.Dataset> Dimensions: (x: 4) Coordinates: * x (x) int64 0 1 2 3 Data variables: A (x) float64 0.0 2.0 0.0 0.0 B (x) float64 3.0 4.0 nan 1.0 C (x) bool True True False False D (x) float64 nan 3.0 nan 4.0

Problem Description

I'd like to use fillna to replace NaN's in some of a Dataset's variables. However, fillna unexpectably converts all variables to float, even if they are boolean or integers.

Would it be possible to apply fillna only on float / object types and consider the value argument, if I only want to apply fillna to a subset of the dataset?

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.7.4 (default, Aug 13 2019, 20:35:49) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 3.10.0-957.27.2.el7.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.4 libnetcdf: 4.6.1 xarray: 0.14.0 pandas: 0.25.1 numpy: 1.17.2 scipy: 1.3.1 netCDF4: 1.4.2 pydap: None h5netcdf: 0.7.4 h5py: 2.9.0 Nio: None zarr: 2.3.2 cftime: 1.0.3.4 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2.5.2 distributed: 2.5.2 matplotlib: 3.1.1 cartopy: None seaborn: 0.9.0 numbagg: None setuptools: 41.4.0 pip: 19.2.3 conda: None pytest: 5.0.1 IPython: 7.8.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3570/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 1358.316ms · About: xarray-datasette