summaryrefslogtreecommitdiff
path: root/numpy/lib/index_tricks.py
diff options
context:
space:
mode:
authorStefan van der Walt <stefan@sun.ac.za>2012-09-02 08:03:42 -0700
committerStefan van der Walt <stefan@sun.ac.za>2012-09-02 08:03:42 -0700
commitbb0e4f356cce2f199d9c08ffe572fbabadc846d1 (patch)
tree336b324007ba1b6b79c70ed28cb9fe9f1015f6c3 /numpy/lib/index_tricks.py
parent942bdb26bee477a8ac2c6b1c1c963c52c7c08403 (diff)
downloadnumpy-bb0e4f356cce2f199d9c08ffe572fbabadc846d1.tar.gz
Retain backward compatibility. Enforce C order.
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r--numpy/lib/index_tricks.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index 112a79bd1..b07fde27d 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -534,11 +534,19 @@ class ndindex(object):
"""
def __init__(self, *shape):
x = as_strided(_nx.zeros(1), shape=shape, strides=_nx.zeros_like(shape))
- self._it = _nx.nditer(x, flags=['multi_index'])
+ self._it = _nx.nditer(x, flags=['multi_index'], order='C')
def __iter__(self):
return self
+ def ndincr(self):
+ """
+ Increment the multi-dimensional index by one.
+
+ This method is for backward compatibility only: do not use.
+ """
+ self.next()
+
def next(self):
"""
Standard iterator method, updates the index and returns the index tuple.