diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2007-02-18 22:43:40 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2007-02-18 22:43:40 +0000 |
commit | 9bcf9ef90b0893a157e5d69478b9a9566b966249 (patch) | |
tree | 409d290d8d465d44b801cf5d38ee4677e7976415 /numpy/core/fromnumeric.py | |
parent | b860a39925a5e0a49d54fa363ccdf6113dfef12d (diff) | |
download | numpy-9bcf9ef90b0893a157e5d69478b9a9566b966249.tar.gz |
Fix doctests.
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 4e42dc892..5bed8933b 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -142,6 +142,7 @@ def choose(a, choices, out=None, mode='raise'): array([20, 31, 12, 3]) >>> choose([2, 4, 1, 0], choices, mode='wrap') array([20, 1, 12, 3]) + """ try: choose = a.choose @@ -173,6 +174,7 @@ def repeat(a, repeats, axis=None): array([0, 0, 1, 1, 2, 2]) >>> repeat([0, 1, 2], [2, 3, 4]) array([0, 0, 1, 1, 1, 2, 2, 2, 2]) + """ try: repeat = a.repeat @@ -487,16 +489,16 @@ def sum(x, axis=None, dtype=None, out=None): x.dtype default sum() dtype --------------------------------------------------- - bool, Int8, Int16, Int32 Int32 + bool, int8, int16, int32 int32 Examples: - >>> sum([0.5, 1.5]) + >>> N.sum([0.5, 1.5]) 2.0 - >>> sum([0.5, 1.5], dtype=Int32) + >>> N.sum([0.5, 1.5], dtype=N.int32) 1 - >>> sum([[0, 1], [0, 5]]) - array([0, 6]) - >>> sum([[0, 1], [0, 5]], axis=1) + >>> N.sum([[0, 1], [0, 5]]) + 6 + >>> N.sum([[0, 1], [0, 5]], axis=1) array([1, 5]) """ if isinstance(x, _gentype): |