summaryrefslogtreecommitdiff
path: root/numpy/lib/index_tricks.py
diff options
context:
space:
mode:
authorStefan van der Walt <stefan@sun.ac.za>2007-02-18 22:43:40 +0000
committerStefan van der Walt <stefan@sun.ac.za>2007-02-18 22:43:40 +0000
commit9bcf9ef90b0893a157e5d69478b9a9566b966249 (patch)
tree409d290d8d465d44b801cf5d38ee4677e7976415 /numpy/lib/index_tricks.py
parentb860a39925a5e0a49d54fa363ccdf6113dfef12d (diff)
downloadnumpy-9bcf9ef90b0893a157e5d69478b9a9566b966249.tar.gz
Fix doctests.
Diffstat (limited to 'numpy/lib/index_tricks.py')
-rw-r--r--numpy/lib/index_tricks.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index 8f8e1b235..5568634e5 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -108,6 +108,7 @@ class nd_grid(object):
[2, 2, 2, 2, 2],
[3, 3, 3, 3, 3],
[4, 4, 4, 4, 4]],
+ <BLANKLINE>
[[0, 1, 2, 3, 4],
[0, 1, 2, 3, 4],
[0, 1, 2, 3, 4],
@@ -118,7 +119,11 @@ class nd_grid(object):
>>> ogrid = nd_grid(sparse=True)
>>> ogrid[0:5,0:5]
- [array([[0],[1],[2],[3],[4]]), array([[0, 1, 2, 3, 4]])]
+ [array([[0],
+ [1],
+ [2],
+ [3],
+ [4]]), array([[0, 1, 2, 3, 4]])]
"""
def __init__(self, sparse=False):
@@ -359,15 +364,15 @@ class ndindex(object):
will then return an N-dimensional counter.
Example:
- >>> for index in ndindex(4,3,2):
- print index
- (0,0,0)
- (0,0,1)
- (0,1,0)
- ...
- (3,1,1)
- (3,2,0)
- (3,2,1)
+ >>> for index in ndindex(3,2,1):
+ ... print index
+ (0, 0, 0)
+ (0, 1, 0)
+ (1, 0, 0)
+ (1, 1, 0)
+ (2, 0, 0)
+ (2, 1, 0)
+
"""
def __init__(self, *args):