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/lib/function_base.py | |
parent | b860a39925a5e0a49d54fa363ccdf6113dfef12d (diff) | |
download | numpy-9bcf9ef90b0893a157e5d69478b9a9566b966249.tar.gz |
Fix doctests.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 14f02f797..5d3e75036 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -665,7 +665,7 @@ def unique(x): Example: >>> unique([5,2,4,0,4,4,2,2,1]) - array([0,1,2,4,5]) + array([0, 1, 2, 4, 5]) """ try: @@ -806,13 +806,13 @@ class vectorize(object): Example: - def myfunc(a, b): - if a > b: - return a-b - else - return a+b + >>> def myfunc(a, b): + ... if a > b: + ... return a-b + ... else: + ... return a+b - vfunc = vectorize(myfunc) + >>> vfunc = vectorize(myfunc) >>> vfunc([1, 2, 3, 4], 2) array([3, 4, 1, 2]) @@ -1197,16 +1197,16 @@ def delete(arr, obj, axis=None): Example: >>> arr = [[3,4,5], - [1,2,3], - [6,7,8]] + ... [1,2,3], + ... [6,7,8]] >>> delete(arr, 1, 1) - array([[3,5], - [1,3], - [6,8]) + array([[3, 5], + [1, 3], + [6, 8]]) >>> delete(arr, 1, 0) - array([[3,4,5], - [6,7,8]]) + array([[3, 4, 5], + [6, 7, 8]]) """ wrap = None if type(arr) is not ndarray: @@ -1300,15 +1300,15 @@ def insert(arr, obj, values, axis=None): Example: >>> a = array([[1,2,3], - [4,5,6], - [7,8,9]]) + ... [4,5,6], + ... [7,8,9]]) >>> insert(a, [1,2], [[4],[5]], axis=0) - array([[1,2,3], - [4,4,4], - [4,5,6], - [5,5,5], - [7,8,9]) + array([[1, 2, 3], + [4, 4, 4], + [4, 5, 6], + [5, 5, 5], + [7, 8, 9]]) """ wrap = None if type(arr) is not ndarray: |