home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 60951607

This data as json

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
60951607 MDExOlB1bGxSZXF1ZXN0MzEwOTI3MTg= 372 API: new methods {Dataset/DataArray}.swap_dims 1217238 closed 0   1004936 2 2015-03-13T01:08:15Z 2015-03-17T15:44:30Z 2015-03-17T15:44:30Z MEMBER   0 pydata/xarray/pulls/372

Fixes #276

Exmaple usage:

``` In [8]: ds = xray.Dataset({'x': range(3), 'y': ('x', list('abc'))})

In [9]: ds Out[9]: <xray.Dataset> Dimensions: (x: 3) Coordinates: * x (x) int64 0 1 2 Data variables: y (x) |S1 'a' 'b' 'c'

In [10]: ds.swap_dims({'x': 'y'}) Out[10]: <xray.Dataset> Dimensions: (y: 3) Coordinates: * y (y) |S1 'a' 'b' 'c' x (y) int64 0 1 2 Data variables: empty ```

This is a slightly more verbose API than strictly necessary, because the new dimension names must be along existing dimensions (e.g., we could spell this ds.set_dims(['y'])). But I still think it's a good idea, for two reasons: 1. It's more explicit. Users control know which dimensions are being swapped. 2. It opens up the possibility of specifying new dimensions with dictionary like syntax, e.g., ds.swap_dims('x': ('y', list('abc')))

CC @aykuznetsova

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/372/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 2 rows from issue in issue_comments
Powered by Datasette · Queries took 208.428ms · About: xarray-datasette