home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

5 rows where state = "open" and user = 3274 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 1

  • issue 5

state 1

  • open · 5 ✖

repo 1

  • xarray 5
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
520137402 MDU6SXNzdWU1MjAxMzc0MDI= 3499 Documentation Feature Request: Rolling and Coordinates rpgoldman 3274 open 0     2 2019-11-08T17:24:40Z 2022-04-29T17:39:44Z   CONTRIBUTOR      

The documentation about iteration with rolling contains the following:

We can also manually iterate through Rolling objects:

for label, arr_window in r:
   # arr_window is a view of x

It would help to explain what sort of thing label is, and how we can use it. It seems to be an object of type Coordinate, but Coordinate does not appear in the API reference.

So I would suggest the two following improvements:

  1. Add an example of using the label and arr_window, maybe plotting the arr_window with the label used to give title.
  2. Tweak the document generator to include docstrings from Coordinate in the API reference section.
  3. Crossreference (hyperlink) from this section of the doc text to the API reference.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3499/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
585323675 MDU6SXNzdWU1ODUzMjM2NzU= 3873 Explanation of full DataFrame to Dataset translation rpgoldman 3274 open 0     4 2020-03-20T20:57:38Z 2020-03-20T23:13:25Z   CONTRIBUTOR      

Using to_xarray() on a DataFrame doesn't get me to the Dataset I want, because typically I want some of the DataFrame's columns to be coordinates, and some Data Variables.

This Stack Exchange question and answer give part of the solution: https://stackoverflow.com/questions/59672658/reassigning-xarray-data-variable-to-xarray-coordinate

This tells us how to turn some of the data variables in the translated data set into coordinates. But that's not the full solution, because we also need the coordinates to be applied to the data variables. Somehow we need to add the variables that are now coordinates as dimensions.

This is probably somewhere in the docs, but it isn't pulled together into a big picture answer. It would be great if there was an end-to-end example of taking a pandas DataFrame, partitioning variables into coordinates and data variables, and being able to use the resulting coordinates (with Dataset.sel()) to address the data variables.

If that is in the online docs, I don't know how to find it. Thanks!

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3873/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
511477827 MDU6SXNzdWU1MTE0Nzc4Mjc= 3437 Request error handling in dataarray construction rpgoldman 3274 open 0     4 2019-10-23T17:48:11Z 2020-01-08T21:14:27Z   CONTRIBUTOR      

When I have a bad dimension in an xarray I get this error:

ValueError: different number of dimensions on data and dims: 2 vs 3

Expected Output

what I would like to see is

ValueError: different number of dimensions on data and dims: 2 vs 3 for variable Foo

The improvement I am asking for is here: https://github.com/pydata/xarray/blob/c8dac5866d2c54ee6b262b5060a701e0be1e40cb/xarray/core/dataarray.py#L368-L371

What I claim would be an improvement would be something like this: data = _check_data_shape(data, coords, dims) data = as_compatible_data(data) try: coords, dims = _infer_coords_and_dims(data.shape, coords, dims) except Exception as e: if name: raise Exception("Error finding coordinates and dims for variable %s: %s"%(name, e) else: raise e variable = Variable(dims, data, attrs, encoding, fastpath=True)

I'm not an expert on python exception handling, so this is probably wrong.

Problem Description

The programmer cannot tell what variable causes the shape and dimension issue.

Output of xr.show_versions()

python: 3.6.8 (default, Sep 6 2019, 11:45:11) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)] python-bits: 64 OS: Darwin OS-release: 18.7.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.2 libnetcdf: 4.6.3 xarray: 0.13.0 pandas: 0.25.2 numpy: 1.17.3 scipy: 1.3.1 netCDF4: 1.5.2 pydap: None h5netcdf: None h5py: 2.10.0 Nio: None zarr: None cftime: 1.0.3.4 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.2.1 dask: None distributed: None matplotlib: 3.1.1 cartopy: None seaborn: 0.9.0 numbagg: None setuptools: 41.2.0 pip: 19.3.1 conda: None pytest: 5.2.0 IPython: 7.8.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3437/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
546956885 MDU6SXNzdWU1NDY5NTY4ODU= 3672 Feature request: pull StackExchange answer into "How Do I?" rpgoldman 3274 open 0     1 2020-01-08T16:08:53Z 2020-01-08T18:14:34Z   CONTRIBUTOR      

There's a great answer to a reshaping question -- how do I subdivide a dimension -- in this StackExchange Q&A: https://stackoverflow.com/questions/43015638/xarray-reshape-data-split-dimension

It would be great to get this moved into the "How do I?" section of the documentation.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3672/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
514191264 MDU6SXNzdWU1MTQxOTEyNjQ= 3461 Poor error message on Dataset.sum(axis=...) rpgoldman 3274 open 0     10 2019-10-29T20:09:51Z 2019-11-18T01:24:56Z   CONTRIBUTOR      

ll_means.nc.gz

MCVE Code Sample

I'm attaching the relevant .nc file.

python foo = xr.open_dataset('ll_means.nc') print(foo) foo.sum(axis=1) # or foo.sum(axis=0)

Instead of getting a sum (either across the data variables or across the dimension shared between the variables), I get the error in the title: ValueError: cannot supply both 'axis' and 'dim' arguments even though I did not supply a dim argument. Furthermore, I get this error even when passing dim=None.

It's possible that I am doing something wrong, and it is just the error message that is bad, and not the behavior. I don't know enough to tell.

Expected Output

TBQH, I didn't know whether this would sum across the (single) dimension of this dataset, or if it would sum across the data variables along that dimension. I was experimenting to try to figure this out.

What I am trying to do is sum across the data variables, "perpendicular" to a dimension, instead of along it.

Problem Description

I assumed that summing across one of the axes would sum across the data variables, but perhaps that was a bad assumption. At any rate, the current behavior is undesirable.

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.7.4 (default, Jul 9 2019, 18:13:23) [Clang 10.0.1 (clang-1001.0.46.4)] python-bits: 64 OS: Darwin OS-release: 18.7.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.2 libnetcdf: 4.6.3 xarray: 0.12.3 pandas: 0.25.1 numpy: 1.17.1 scipy: 1.3.1 netCDF4: 1.5.2 pydap: None h5netcdf: None h5py: 2.9.0 Nio: None zarr: None cftime: 1.0.3.4 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: None distributed: None matplotlib: 3.1.1 cartopy: None seaborn: 0.9.0 numbagg: None setuptools: 41.2.0 pip: 19.3.1 conda: None pytest: None IPython: 7.8.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3461/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 20.784ms · About: xarray-datasette