home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1239892847

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
1239892847 I_kwDOAMm_X85J50Nv 6619 xr.polyval: return nan when evaluating a curve with nan coefficients 2129135 closed 0     2 2022-05-18T12:36:24Z 2022-05-18T15:24:28Z 2022-05-18T15:16:28Z NONE      

What happened?

Evaluating the coefficients from a polyfit that happened to be none results in a polyval evaluation of zeros.

What did you expect to happen?

I expect the result to be nan when an input is nan as well. Note passing in skipna=True to polyfit does not make a difference.

Minimal Complete Verifiable Example

Python import xarray as xr import numpy as np arr = xr.DataArray(np.ones(100)*np.nan, dims=["time"], coords={"time": np.arange(100)}) xr.polyval(arr.time, arr.polyfit(dim="time", deg=1))

MVCE confirmation

  • [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [ ] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [ ] 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

: None seaborn: None numbagg: None fsspec: 2022.01.0 cupy: None pint: None sparse: None setuptools: 61.2.0.post0 pip: None conda: None pytest: 7.1.1 IPython: 8.2.0 sphinx: 4.5.0
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6619/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

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