diff options
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r-- | numpy/core/src/arraymethods.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index 366e07966..ac14d22d1 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -494,7 +494,8 @@ array_toscalar(PyArrayObject *self, PyObject *args) { return NULL; } if (self->nd == 1) { - return self->descr->f->getitem(self->data + value, + value *= self->strides[0]; + return self->descr->f->getitem(self->data + value, self); } nd = self->nd; @@ -600,6 +601,7 @@ array_setscalar(PyArrayObject *self, PyObject *args) { return NULL; } if (self->nd == 1) { + value *= self->strides[0]; ret = self->descr->f->setitem(obj, self->data + value, self); goto finish; |