diff options
author | Ralf Gommers <ralf.gommers@googlemail.com> | 2012-07-07 16:07:39 +0200 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@googlemail.com> | 2012-07-07 16:38:37 +0200 |
commit | 436a28f4ea4d596c59e85745eac7446f7e18903f (patch) | |
tree | 2b4ad5911d86b5721705f5c03da427498d868849 /numpy/lib | |
parent | 3b9a0fea12ae89fe6ce745d9af0beb3df17260b8 (diff) | |
parent | ffca0587e99f3b3ecce80fa8cfd28bdf17abbf31 (diff) | |
download | numpy-436a28f4ea4d596c59e85745eac7446f7e18903f.tar.gz |
Merge branch 'merge-wiki-edits' into master.
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/arraysetops.py | 16 | ||||
-rw-r--r-- | numpy/lib/function_base.py | 18 | ||||
-rw-r--r-- | numpy/lib/npyio.py | 3 | ||||
-rw-r--r-- | numpy/lib/type_check.py | 12 |
4 files changed, 27 insertions, 22 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index 91dd96f9c..20a0e7151 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -44,7 +44,7 @@ def ediff1d(ary, to_end=None, to_begin=None): Returns ------- - ed : ndarray + ediff1d : ndarray The differences. Loosely, this is ``ary.flat[1:] - ary.flat[:-1]``. See Also @@ -212,7 +212,7 @@ def intersect1d(ar1, ar2, assume_unique=False): Returns ------- - out : ndarray + intersect1d : ndarray Sorted 1D array of common and unique elements. See Also @@ -251,7 +251,7 @@ def setxor1d(ar1, ar2, assume_unique=False): Returns ------- - xor : ndarray + setxor1d : ndarray Sorted 1D array of unique values that are in only one of the input arrays. @@ -287,7 +287,7 @@ def in1d(ar1, ar2, assume_unique=False): Parameters ---------- - ar1 : array_like, shape (M,) + ar1 : (M,) array_like Input array. ar2 : array_like The values against which to test each value of `ar1`. @@ -297,8 +297,8 @@ def in1d(ar1, ar2, assume_unique=False): Returns ------- - mask : ndarray of bools, shape(M,) - The values `ar1[mask]` are in `ar2`. + in1d : (M,) ndarray, bool + The values `ar1[in1d]` are in `ar2`. See Also -------- @@ -365,7 +365,7 @@ def union1d(ar1, ar2): Returns ------- - union : ndarray + union1d : ndarray Unique, sorted union of the input arrays. See Also @@ -399,7 +399,7 @@ def setdiff1d(ar1, ar2, assume_unique=False): Returns ------- - difference : ndarray + setdiff1d : ndarray Sorted 1D array of values in `ar1` that are not in `ar2`. See Also diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index f3df3b96b..a0781ebf9 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -843,7 +843,7 @@ def gradient(f, *varargs): Returns ------- - g : ndarray + gradient : ndarray N arrays of the same shape as `f` giving the derivative of `f` with respect to each dimension. @@ -948,7 +948,7 @@ def diff(a, n=1, axis=-1): Returns ------- - out : ndarray + diff : ndarray The `n` order differences. The shape of the output is the same as `a` except along `axis` where the dimension is smaller by `n`. @@ -1284,6 +1284,11 @@ def extract(condition, arr): arr : array_like Input array of the same size as `condition`. + Returns + ------- + extract : ndarray + Rank 1 array of values from `arr` where `condition` is True. + See Also -------- take, put, copyto, compress @@ -1316,9 +1321,10 @@ def place(arr, mask, vals): """ Change elements of an array based on conditional and input values. - Similar to ``np.copyto(arr, vals, where=mask)``, the difference is that `place` - uses the first N elements of `vals`, where N is the number of True values - in `mask`, while `copyto` uses the elements where `mask` is True. + Similar to ``np.copyto(arr, vals, where=mask)``, the difference is that + `place` uses the first N elements of `vals`, where N is the number of + True values in `mask`, while `copyto` uses the elements where `mask` + is True. Note that `extract` does the exact opposite of `place`. @@ -2713,7 +2719,7 @@ def kaiser(M,beta): A beta value of 14 is probably a good starting point. Note that as beta gets large, the window narrows, and so the number of samples needs to be - large enough to sample the increasingly narrow spike, otherwise nans will + large enough to sample the increasingly narrow spike, otherwise NaNs will get returned. Most references to the Kaiser window come from the signal processing diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index cb14e4963..b1e891f77 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -470,8 +470,7 @@ def savez(file, *args, **kwds): -------- save : Save a single array to a binary file in NumPy format. savetxt : Save an array to a file as plain text. - numpy.savez_compressed : Save several arrays into a compressed .npz file - format + savez_compressed : Save several arrays into a compressed .npz file format Notes ----- diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py index c116c7e4a..e22d63156 100644 --- a/numpy/lib/type_check.py +++ b/numpy/lib/type_check.py @@ -233,11 +233,10 @@ def isreal(x): def iscomplexobj(x): """ - Return True if x is a complex type or an array of complex numbers. + Check for a complex type or an array of complex numbers. - The type of the input is checked, not the value. So even if the input - has an imaginary part equal to zero, `iscomplexobj` evaluates to True - if the data type is complex. + The type of the input is checked, not the value. Even if the input + has an imaginary part equal to zero, `iscomplexobj` evaluates to True. Parameters ---------- @@ -246,8 +245,9 @@ def iscomplexobj(x): Returns ------- - y : bool - The return value, True if `x` is of a complex type. + iscomplexobj : bool + The return value, True if `x` is of a complex type or has at least + one complex element. See Also -------- |