bottleneck : Wrong mean for float32 array
See original GitHub issueI think it is better to have this discussion here instead of on the dask page https://github.com/dask/dask/issues/2095
This is the replicable “bug”:
ds = xarray.open_dataset('/opt/data/ERAIN/ERAIN-t2m-1983-2012.seasmean.nc')
ds.var167.mean()
Out[14]:
<xarray.DataArray 'var167' ()>
array(261.6441345214844)
ds.var167.data.mean()
Out[15]: 278.62466
The dataset is ~65 MB, here the file https://www.dropbox.com/s/xtj3fm7ihtbwd5r/ERAIN-t2m-1983-2012.seasmean.nc?dl=0 It is a quite normal NetCDF (no NaN), just processed with CDO as you can see on the dask issue.
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (15 by maintainers)
Top Results From Across the Web
bottleneck Documentation
Mean of array elements along given axis ignoring NaNs. float64 intermediate and return values are used for integer inputs. Parameters.
Read more >cannot compute moving average with bottleneck package
I'm using package bottleneck in order to compute a moving average of a np array. My data is an array with shape (1247,1)...
Read more >Bottleneck distance user manual — gudhi documentation - Inria
Bottleneck distance measures the similarity between two persistence diagrams. It's the shortest distance b for which there exists a perfect matching between ...
Read more >Bottleneck - PyPI
import numpy as np >>> a = np.array([1, 2, np.nan, 4, 5]). Find the nanmean: >>> import bottleneck as bn >>> bn.nanmean(a) 3.0....
Read more >Storage Latency - Shifting Bottleneck - NetApp Community
Originally SANs were designed with hard disk drives in mind, which meant that the bottleneck was the spinning disks.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I would rather pick option (1) above, that is, “Stop using bottleneck on float32 arrays”
On second thought we should add this to a FAQ page.