home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 494210818

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
494210818 MDExOlB1bGxSZXF1ZXN0MzE4MDA5MjU3 3312 convert DataArray to DataSet before combine 10554254 open 0     10 2019-09-16T18:37:35Z 2022-06-09T14:50:17Z   FIRST_TIME_CONTRIBUTOR   0 pydata/xarray/pulls/3312

Enables combine_by_coords on DataArrays. Will convert DataArray to DataSet before proceeding.

As mentioned in #3248, this will still fail if the DataArray is unnamed, but at least the error message tells the user why.

Previously, combining both named

``` da1 = xr.DataArray(name='foo', data=np.random.rand(3,3), coords=[('x', [1, 2, 3]), ('y', [1, 2, 3])])

da2 = xr.DataArray(name='foo2', data=np.random.rand(3,3), coords=[('x', [5, 6, 7]), ('y', [5, 6, 7])])

xr.combine_by_coords([da1, da2]) ```

and unnamed DataArrays ``` da1 = xr.DataArray(data=np.random.rand(3,3), coords=[('x', [1, 2, 3]), ('y', [1, 2, 3])])

da2 = xr.DataArray(data=np.random.rand(3,3), coords=[('x', [5, 6, 7]), ('y', [5, 6, 7])])

xr.combine_by_coords([da1, da2]) `` failed withValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()`

With this PR, combining the named DataArrays results in a combined DataSet, while the latter example will result in ValueError: unable to convert unnamed DataArray to a Dataset without providing an explicit name

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3312/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
  • 10 rows from issue in issue_comments
Powered by Datasette · Queries took 0.571ms · About: xarray-datasette