Comments (2)
The issue seems that the transposed array is F_CONTIGUOUS and bottleneck wrongly uses the first non-zero stride for iteration. This patch fixes this issue for me but I have not tested it thoroughly on Windows:
diff --git a/bottleneck/include/iterators.h b/bottleneck/include/iterators.h
index 1f5120a..c70c46a 100644
--- a/bottleneck/include/iterators.h
+++ b/bottleneck/include/iterators.h
@@ -108,7 +108,7 @@ static inline void init_iter_all(iter *it, PyArrayObject *a, int ravel, int anyo
for (i = ndim - 1; i > -1; i--) {
/* protect against length zero strides such as in
* np.ones((2, 2))[..., np.newaxis] */
- if (strides[i] == 0) {
+ if ((strides[i] == 0) || (shape[i] == 1)) {
continue;
}
it->astride = strides[i];
@@ -122,7 +122,7 @@ static inline void init_iter_all(iter *it, PyArrayObject *a, int ravel, int anyo
for (i = 0; i < ndim; i++) {
/* protect against length zero strides such as in
* np.ones((2, 2), order='F')[np.newaxis, ...] */
- if (strides[i] == 0) {
+ if ((strides[i] == 0) || (shape[i] == 1)) {
continue;
}
it->astride = strides[i];
The shape, strides, and flags of the transposed array are:
(1, 121, 192)
(185856, 8, 968)
C_CONTIGUOUS : False
F_CONTIGUOUS : True
OWNDATA : False
WRITEABLE : True
ALIGNED : True
WRITEBACKIFCOPY : False
UPDATEIFCOPY : False
from bottleneck.
Probably a duplicate of #381 and fixed by #382.
from bottleneck.
Related Issues (20)
- [Enhancement] Weighted Median function
- Python crashed in fuzzing test of 7 APIs HOT 1
- Wrong rolling window calculations
- [Enhancement] Add move_skew and move_kurt HOT 2
- I think no Bug - just a unexperienced elderly user... having Vers. 1.2.1 HOT 3
- Continuous fuzzing by way of OSS-Fuzz
- [BUG] NumPy 1.24: test regression `ValueError: cannot convert float NaN to integer` HOT 6
- 👋 Additional maintainers wanted! HOT 2
- Can you add 'nanquantile' to this project? HOT 2
- Ignore length check HOT 1
- use move_mean and set window&min_count =1, diff result
- [ENHANCEMENT] move_rank is twice as slow as pandas.rolling.rank
- [BUG]would it be possible to have Python-3.12 wheels ? HOT 2
- [BUG] bottleneck gives erroneous standard deviation in Pandas with float32 array. HOT 4
- [BUG]Can't install on MacOSX 14.1.1 HOT 3
- Seeking advice on implementing certain operators on GPU
- 2D window implementation
- Can built package drop versioneer dependency? HOT 2
- ADD a 'move_apply' function
- ImportError: numpy.core.multiarray failed to import with NumPy 2.0.0 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bottleneck.