home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

2 rows where state = "open", type = "issue" and user = 97012127 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
1854814561 I_kwDOAMm_X85ujjlh 8077 Video for the Contributing Guide harshitha1201 97012127 open 0     0 2023-08-17T11:29:07Z 2023-08-17T11:50:38Z   CONTRIBUTOR      

Is your feature request related to a problem?

There is no video for the setting up of xarray locally on windows.

Describe the solution you'd like

Maybe a video tutorial might be the solution making it beginner-friendly.

Describe alternatives you've considered

No response

Additional context

I'm providing the Google Docs Link, please do add any suggestions.

I'll be recording the video on 20th August.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/8077/reactions",
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
1782816429 I_kwDOAMm_X85qQ56t 7954 Dataset.reduce fails wheras Dataarray.reduce succeds harshitha1201 97012127 open 0     3 2023-06-30T16:29:10Z 2023-07-13T17:56:27Z   CONTRIBUTOR      

What happened?

I tried to reduce dataset using scipy.stats.skew, but it raised an error.

What did you expect to happen?

I expected it to succed, especially because the same operation with dataarray succeeds.

Minimal Complete Verifiable Example

```Python

dataset = xr.Dataset( ... { ... "math_scores": ( ... ["student", "test"], ... [[90, 85, 92], [78, 80, 85], [95, 92, 98]], ... ), ... "english_scores": ( ... ["student", "test"], ... [[88, 90, 92], [75, 82, 79], [93, 96, 91]], ... ), ... }, ... coords={ ... "student": ["Alice", "Bob", "Charlie"], ... "test": ["Test 1", "Test 2", "Test 3"], ... }, ... )

from scipy.stats import skew

Calling DataArray.reduce on each variable individually succeeds

In [14]: dataset['math_scores'].reduce(skew, dim=["test", 'student']) Out[14]: <xarray.DataArray 'math_scores' ()> array(-0.19423043)

In [15]: dataset['english_scores'].reduce(skew, dim=["test", 'student']) Out[15]: <xarray.DataArray 'english_scores' ()> array(-0.60125)

But calling Dataset.reduce fails

dataset.reduce(skew, dim=["test", 'student'])


ValueError Traceback (most recent call last) Cell In[16], line 1 ----> 1 dataset.reduce(skew, dim=["test", 'student'])

File ~/Documents/Work/Code/xarray/xarray/core/dataset.py:5972, in Dataset.reduce(self, func, dim, keep_attrs, keepdims, numeric_only, kwargs) 5955 if ( 5956 # Some reduction functions (e.g. std, var) need to run on variables 5957 # that don't have the reduce dims: PR5393 (...) 5965 # the former is often more efficient 5966 # keep single-element dims as list, to support Hashables 5967 reduce_maybe_single = ( 5968 None 5969 if len(reduce_dims) == var.ndim and var.ndim != 1 5970 else reduce_dims 5971 ) -> 5972 variables[name] = var.reduce( 5973 func, 5974 dim=reduce_maybe_single, 5975 keep_attrs=keep_attrs, 5976 keepdims=keepdims, 5977 kwargs, 5978 ) 5980 coord_names = {k for k in self.coords if k in variables} 5981 indexes = {k: v for k, v in self._indexes.items() if k in variables}

File ~/Documents/Work/Code/xarray/xarray/core/variable.py:2045, in Variable.reduce(self, func, dim, axis, keep_attrs, keepdims, **kwargs) 2042 keep_attrs = _get_keep_attrs(default=False) 2043 attrs = self._attrs if keep_attrs else None -> 2045 return Variable(dims, data, attrs=attrs)

File ~/Documents/Work/Code/xarray/xarray/core/variable.py:367, in Variable.init(self, dims, data, attrs, encoding, fastpath) 347 """ 348 Parameters 349 ---------- (...) 364 unrecognized encoding items. 365 """ 366 self._data = as_compatible_data(data, fastpath=fastpath) --> 367 self._dims = self._parse_dimensions(dims) 368 self._attrs = None 369 self._encoding = None

File ~/Documents/Work/Code/xarray/xarray/core/variable.py:683, in Variable._parse_dimensions(self, dims) 681 dims = tuple(dims) 682 if len(dims) != self.ndim: --> 683 raise ValueError( 684 f"dimensions {dims} must have the same length as the " 685 f"number of data dimensions, ndim={self.ndim}" 686 ) 687 return dims

ValueError: dimensions () must have the same length as the number of data dimensions, ndim=1 ```

MVCE confirmation

  • [x] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [x] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [x] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

No response

Environment

xarray main branch

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7954/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 1282.258ms · About: xarray-datasette