Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e8c4f97

Browse files
committed
Fix swap error for indexing flat attribute. The data-type of the returned object keeps the byte-swap information so there is no need to swap.
1 parent 908adda commit e8c4f97

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

THANKS.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Jim Hugunin, Paul Dubois, Konrad Hinsen, David Ascher, and many others for
33
Numeric on which the code is based.
44
Perry Greenfield, J Todd Miller, Rick White, Paul Barrett for Numarray
55
which gave much inspiration and showed the way forward.
6-
Paul Dubois for Masked Arrays
6+
Paul Dubois for original Masked Arrays
77
Pearu Peterson for f2py and numpy.distutils and help with code organization
88
Robert Kern for mtrand, bug fixes, help with distutils, code organization,
99
and much more.
@@ -34,5 +34,5 @@ Albert Strasheim for documentation, bug-fixes, regression tests and
3434
Valgrind expertise.
3535
Stefan van der Walt for documentation, bug-fixes and regression-tests.
3636
Andrew Straw for help with http://www.scipy.org, documentation, and testing.
37-
David Cournapeau for documentation, bug-fixes, and code contributions including fast_clipping.
37+
David Cournapeau for scons build support, doc-and-bug fixes, and code contributions including fast_clipping.
3838
Pierre Gerard-Marchant for his rewrite of the masked array functionality.

numpy/core/src/arrayobject.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9283,10 +9283,9 @@ iter_subscript(PyArrayIterObject *self, PyObject *ind)
92839283
0, (PyObject *)self->ao);
92849284
if (r==NULL) goto fail;
92859285
dptr = PyArray_DATA(r);
9286-
swap = !PyArray_ISNOTSWAPPED(self->ao);
92879286
copyswap = PyArray_DESCR(r)->f->copyswap;
92889287
while(n_steps--) {
9289-
copyswap(dptr, self->dataptr, swap, r);
9288+
copyswap(dptr, self->dataptr, 0, r);
92909289
start += step_size;
92919290
PyArray_ITER_GOTO1D(self, start)
92929291
dptr += size;

0 commit comments

Comments
 (0)