home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 120508785

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
120508785 MDExOlB1bGxSZXF1ZXN0NTI3MzYwOTc= 670 Add broadcast function to the API 1217238 closed 0     3 2015-12-04T23:41:56Z 2016-01-01T22:13:17Z 2016-01-01T22:13:05Z MEMBER   0 pydata/xarray/pulls/670

This is a renaming and update of the existing xray.broadcast_arrays function, which now works properly in the light of #648.

xref #649 cc @rabernat

Examples

Broadcast two data arrays against one another to fill out their dimensions:

```

a = xray.DataArray([1, 2, 3], dims='x') b = xray.DataArray([5, 6], dims='y') a <xray.DataArray (x: 3)> array([1, 2, 3]) Coordinates: * x (x) int64 0 1 2 b <xray.DataArray (y: 2)> array([5, 6]) Coordinates: * y (y) int64 0 1 a2, b2 = xray.broadcast(a, b) a2 <xray.DataArray (x: 3, y: 2)> array([[1, 1], [2, 2], [3, 3]]) Coordinates: * x (x) int64 0 1 2 * y (y) int64 0 1 b2 <xray.DataArray (x: 3, y: 2)> array([[5, 6], [5, 6], [5, 6]]) Coordinates: * y (y) int64 0 1 * x (x) int64 0 1 2 ```

Fill out the dimensions of all data variables in a dataset:

```

ds = xray.Dataset({'a': a, 'b': b}) ds2, = xray.broadcast(ds) # use tuple unpacking to extract one dataset ds2 <xray.Dataset> Dimensions: (x: 3, y: 2) Coordinates: * x (x) int64 0 1 2 * y (y) int64 0 1 Data variables: a (x, y) int64 1 1 2 2 3 3 b (x, y) int64 5 6 5 6 5 6 ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/670/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

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