issues: 578736255
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
578736255 | MDU6SXNzdWU1Nzg3MzYyNTU= | 3855 | `rolling.mean` gives negative values on non-negative array. | 2272878 | closed | 0 | 6 | 2020-03-10T17:13:46Z | 2023-11-14T08:25:58Z | 2020-03-10T18:51:13Z | CONTRIBUTOR | When doing a rolling mean on an array with no negative values, the result somehow contains negative values anyway. This shouldn't be possible, since the mean of non-negative values can never be zero. Further, it only happens when using the MCVE Code SampleTake the following xarray ```Python import numpy as np import scipy as sp import xarray as xr soundlen=10000 np.random.seed(1) noise = np.random.randn(soundlen) noise = sp.signal.hann(soundlen) noise2 = noise*2 xnoise = xr.DataArray(noise2, dims='temp', coords={'temp': np.arange(soundlen)}) print(xnoise.min()) ``` The result is Using ```Python
Similarly, using
However, using the
This mathematically shouldn't be possible. Versions
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3855/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |