[Numpy-svn] r3157 - trunk/numpy/core/src

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Sep 14 18:41:02 CDT 2006


Author: oliphant
Date: 2006-09-14 18:40:52 -0500 (Thu, 14 Sep 2006)
New Revision: 3157

Modified:
   trunk/numpy/core/src/arraymethods.c
Log:
Fix problem with .item(n) for 1-d case.

Modified: trunk/numpy/core/src/arraymethods.c
===================================================================
--- trunk/numpy/core/src/arraymethods.c	2006-09-14 21:39:21 UTC (rev 3156)
+++ trunk/numpy/core/src/arraymethods.c	2006-09-14 23:40:52 UTC (rev 3157)
@@ -494,7 +494,8 @@
                         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 @@
                         return NULL;
                 }
                 if (self->nd == 1) {
+                        value *= self->strides[0];
                         ret = self->descr->f->setitem(obj, self->data + value, 
                                                       self);
                         goto finish;



More information about the Numpy-svn mailing list