summaryrefslogtreecommitdiff
path: root/numpy/lib/index_tricks.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-06-21 17:24:29 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-06-21 17:24:29 +0000
commit1c2110fffea05d08fb327b68b552d4d0f830a63c (patch)
tree4c1950e7c5efad7c28eb21437c3bb6368c25386a /numpy/lib/index_tricks.py
parent165a1f58ad0a5f2dbe77a85bd1a3e4eb37b4daaa (diff)
downloadnumpy-1c2110fffea05d08fb327b68b552d4d0f830a63c.tar.gz
Add boolean indexing capability mixed with slice objects.
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r--numpy/lib/index_tricks.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index c659c7584..6f06bab78 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -75,6 +75,8 @@ def ix_(*args):
new = _nx.array(args[k])
if (new.ndim != 1):
raise ValueError, "Cross index must be 1 dimensional"
+ if issubclass(new.dtype.type, _nx.bool_):
+ new = new.nonzero()[0]
baseshape[k] = len(new)
new.shape = tuple(baseshape)
out.append(new)