diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-09-14 23:40:52 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-09-14 23:40:52 +0000 |
commit | 2259299c824b866df8c1ddcf2f7f6ba14930abbd (patch) | |
tree | 9d402ef2153e68fe1a5f80a0035b481e780abfd7 /numpy/core/src/arraymethods.c | |
parent | b2d51134f0720795c1885ca6ef362360509eb43e (diff) | |
download | numpy-2259299c824b866df8c1ddcf2f7f6ba14930abbd.tar.gz |
Fix problem with .item(n) for 1-d case.
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; |