home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 345478817

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
345478817 MDU6SXNzdWUzNDU0Nzg4MTc= 2327 dimensions of interpolated output at single location depends on whether a scalar or list is provided 2448579 closed 0     2 2018-07-28T21:03:46Z 2018-07-28T22:48:28Z 2018-07-28T22:48:28Z MEMBER      

See below, in the first the output has no dimension but has a co-ordinate.

Code Sample, a copy-pastable example if possible

python da = xr.DataArray([1, 2, 3], dims='a', coords={'a': [1, 2, 3]}) da.interp(a=1.5) <xarray.DataArray ()> array(1.5) Coordinates: a float64 1.5

while python da.interp(a=[1.5]) ``` <xarray.DataArray (a: 1)> array([1.5]) Coordinates: * a (a) float64 1.5 ````

I think the latter should be the answer always. It's surprising to lose a dimension on interpolating...

The fix should occur here, I think: https://github.com/pydata/xarray/blob/f281945fcacbfc1dbaa48fb15546fae5317bdda8/xarray/core/dataset.py#L1330

Changing that to np.atleast_1d breaks tests though :/ @fujiisoup

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

Links from other tables

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