Permalink
Browse files

Merge branch 'merge-wiki-edits' into master.

  • Loading branch information...
2 parents 3b9a0fe + ffca058 commit 436a28f4ea4d596c59e85745eac7446f7e18903f @rgommers rgommers committed Jul 7, 2012
View
7 doc/source/dev/gitwash/development_setup.rst
@@ -38,8 +38,8 @@ Create your own forked copy of NumPy_
.. image:: forking_button.png
- Now, after a short pause and some 'Hardcore forking action', you
- should find yourself at the home page for your own forked copy of NumPy_.
+ After a short pause, you should find yourself at the home page for
+ your own forked copy of NumPy_.
.. include:: git_links.inc
@@ -49,7 +49,7 @@ Create your own forked copy of NumPy_
Set up your fork
################
-First you follow the instructions for :ref:`forking`.
+First you follow the instructions for :ref:`forking`.
Overview
========
@@ -110,4 +110,3 @@ Just for your own satisfaction, show yourself that you now have a new
origin git@github.com:your-user-name/numpy.git (push)
.. include:: git_links.inc
-
View
3 doc/source/reference/index.rst
@@ -7,6 +7,7 @@ NumPy Reference
:Release: |version|
:Date: |today|
+
.. module:: numpy
This reference manual details functions, modules, and objects
@@ -20,7 +21,7 @@ For learning how to use NumPy, see also :ref:`user`.
arrays
ufuncs
routines
- ctypes
+ ctypeslib
distutils
c-api
internals
View
27 doc/source/reference/routines.matlib.rst
@@ -7,5 +7,30 @@ This module contains all functions in the :mod:`numpy` namespace, with
the following replacement functions that return :class:`matrices
<matrix>` instead of :class:`ndarrays <ndarray>`.
-.. automodule:: numpy.matlib
+.. currentmodule:: numpy
+
+Functions that are also in the numpy namespace and return matrices
+
+.. autosummary::
+
+ mat
+ matrix
+ asmatrix
+ bmat
+
+
+Replacement functions in `matlib`
+
+.. currentmodule:: numpy.matlib
+
+.. autosummary::
+ :toctree: generated/
+ empty
+ zeros
+ ones
+ eye
+ identity
+ repmat
+ rand
+ randn
View
27 doc/source/reference/routines.polynomials.rst
@@ -1,23 +1,32 @@
Polynomials
***********
-The polynomial package is newer and more complete than poly1d and the
-convenience classes are better behaved in the numpy environment. When
-backwards compatibility is not an issue it should be the package of choice.
-Note that the various routines in the polynomial package all deal with
-series whose coefficients go from degree zero upward, which is the reverse
-of the poly1d convention. The easy way to remember this is that indexes
+Polynomials in NumPy can be *created*, *manipulated*, and even *fitted* using
+the :doc:`routines.polynomials.classes`
+of the `numpy.polynomial` package, introduced in NumPy 1.4.
+
+Prior to NumPy 1.4, `numpy.poly1d` was the class of choice and it is still
+available in order to maintain backward compatibility.
+However, the newer Polynomial package is more complete than `numpy.poly1d`
+and its convenience classes are better behaved in the numpy environment.
+Therefore Polynomial is recommended for new coding.
+
+Transition notice
+-----------------
+The various routines in the Polynomial package all deal with
+series whose coefficients go from degree zero upward,
+which is the *reverse order* of the Poly1d convention.
+The easy way to remember this is that indexes
correspond to degree, i.e., coef[i] is the coefficient of the term of
degree i.
.. toctree::
:maxdepth: 2
- routines.polynomials.poly1d
-
+ routines.polynomials.package
.. toctree::
:maxdepth: 2
- routines.polynomials.package
+ routines.polynomials.poly1d
View
4 doc/source/reference/routines.random.rst
@@ -37,7 +37,7 @@ Distributions
beta
binomial
chisquare
- mtrand.dirichlet
+ dirichlet
exponential
f
gamma
@@ -75,7 +75,7 @@ Random generator
.. autosummary::
:toctree: generated/
- mtrand.RandomState
+ RandomState
seed
get_state
set_state
View
7 doc/source/reference/routines.statistics.rst
@@ -4,17 +4,18 @@ Statistics
.. currentmodule:: numpy
-Extremal values
----------------
+Order statistics
+----------------
.. autosummary::
:toctree: generated/
amin
amax
- nanmax
nanmin
+ nanmax
ptp
+ percentile
Averages and variances
----------------------
View
22 numpy/add_newdocs.py
@@ -1822,10 +1822,21 @@ def luf(lamdaexpr, *args, **kwargs):
""")
-add_newdoc('numpy.core.multiarray','newbuffer',
- """newbuffer(size)
+add_newdoc('numpy.core.multiarray', 'newbuffer',
+ """
+ newbuffer(size)
+
+ Return a new uninitialized buffer object.
- Return a new uninitialized buffer object of size bytes
+ Parameters
+ ----------
+ size : int
+ Size in bytes of returned buffer object.
+
+ Returns
+ -------
+ newbuffer : buffer object
+ Returned, uninitialized buffer object of `size` bytes.
""")
@@ -3717,8 +3728,9 @@ def luf(lamdaexpr, *args, **kwargs):
"""
copyto(dst, src, casting='same_kind', where=None, preservena=False)
- Copies values from `src` into `dst`, broadcasting as necessary.
- Raises a TypeError if the casting rule is violated, and if
+ Copies values from one array to another, broadcasting as necessary.
+
+ Raises a TypeError if the `casting` rule is violated, and if
`where` is provided, it selects which elements to copy.
.. versionadded:: 1.7.0
View
114 numpy/core/defchararray.py
@@ -259,19 +259,22 @@ def str_len(a):
def add(x1, x2):
"""
- Return (x1 + x2), that is string concatenation, element-wise for a
- pair of array_likes of str or unicode.
+ Return element-wise string concatenation for two arrays of str or unicode.
+
+ Arrays `x1` and `x2` must have the same shape.
Parameters
----------
x1 : array_like of str or unicode
-
+ Input array.
x2 : array_like of str or unicode
+ Input array.
Returns
-------
add : ndarray
Output array of `string_` or `unicode_`, depending on input types
+ of the same shape as `x1` and `x2`.
"""
arr1 = numpy.asarray(x1)
@@ -346,6 +349,7 @@ def capitalize(a):
Parameters
----------
a : array_like of str or unicode
+ Input array of strings to capitalize.
Returns
-------
@@ -365,6 +369,7 @@ def capitalize(a):
>>> np.char.capitalize(c)
array(['A1b2', '1b2a', 'B2a1', '2a1b'],
dtype='|S4')
+
"""
a_arr = numpy.asarray(a)
return _vec_string(a_arr, a_arr.dtype, 'capitalize')
@@ -960,19 +965,20 @@ def ljust(a, width):
def lower(a):
"""
- Return an array with the elements of `a` converted to lowercase.
+ Return an array with the elements converted to lowercase.
Call `str.lower` element-wise.
For 8-bit strings, this method is locale-dependent.
Parameters
----------
- a : array-like of str or unicode
+ a : array_like, {str, unicode}
+ Input array.
Returns
-------
- out : ndarray, str or unicode
+ out : ndarray, {str, unicode}
Output array of str or unicode, depending on input type
See also
@@ -987,6 +993,7 @@ def lower(a):
>>> np.char.lower(c)
array(['a1b c', '1bca', 'bca1'],
dtype='|S5')
+
"""
a_arr = numpy.asarray(a)
return _vec_string(a_arr, a_arr.dtype, 'lower')
@@ -1000,18 +1007,19 @@ def lstrip(a, chars=None):
Parameters
----------
- a : array-like of str or unicode
+ a : array-like, {str, unicode}
+ Input array.
- chars : str or unicode, optional
- The `chars` argument is a string specifying the set of
- characters to be removed. If omitted or None, the `chars`
- argument defaults to removing whitespace. The `chars` argument
- is not a prefix; rather, all combinations of its values are
- stripped.
+ chars : {str, unicode}, optional
+ The `chars` argument is a string specifying the set of
+ characters to be removed. If omitted or None, the `chars`
+ argument defaults to removing whitespace. The `chars` argument
+ is not a prefix; rather, all combinations of its values are
+ stripped.
Returns
-------
- out : ndarray, str or unicode
+ out : ndarray, {str, unicode}
Output array of str or unicode, depending on input type
See also
@@ -1024,9 +1032,14 @@ def lstrip(a, chars=None):
>>> c
array(['aAaAaA', ' aA ', 'abBABba'],
dtype='|S7')
- >>> np.char.lstrip(c, 'a') # 'a' unstripped from c[1] because whitespace leading
+
+ The 'a' variable is unstripped from c[1] because whitespace leading.
+
+ >>> np.char.lstrip(c, 'a')
array(['AaAaA', ' aA ', 'bBABba'],
dtype='|S7')
+
+
>>> np.char.lstrip(c, 'A') # leaves c unchanged
array(['aAaAaA', ' aA ', 'abBABba'],
dtype='|S7')
@@ -1056,19 +1069,22 @@ def partition(a, sep):
Parameters
----------
- a : array-like of str or unicode
- sep : str or unicode
+ a : array_like, {str, unicode}
+ Input array
+ sep : {str, unicode}
+ Separator to split each string element in `a`.
Returns
-------
- out : ndarray
+ out : ndarray, {str, unicode}
Output array of str or unicode, depending on input type.
The output array will have an extra dimension with 3
elements per input element.
See also
--------
str.partition
+
"""
return _to_string_or_unicode_array(
_vec_string(a, object_, 'partition', (sep,)))
@@ -1229,7 +1245,7 @@ def rjust(a, width):
if sys.version_info >= (2, 5):
def rpartition(a, sep):
"""
- Partition each element in `a` around `sep`.
+ Partition (split) each element around the right-most separator.
Calls `str.rpartition` element-wise.
@@ -1241,8 +1257,10 @@ def rpartition(a, sep):
Parameters
----------
- a : array-like of str or unicode
+ a : array_like of str or unicode
+ Input array
sep : str or unicode
+ Right-most separator to split each element in array.
Returns
-------
@@ -1254,6 +1272,7 @@ def rpartition(a, sep):
See also
--------
str.rpartition
+
"""
return _to_string_or_unicode_array(
_vec_string(a, object_, 'rpartition', (sep,)))
@@ -1478,7 +1497,7 @@ def strip(a, chars=None):
def swapcase(a):
"""
- For each element in `a`, return a copy of the string with
+ Return element-wise a copy of the string with
uppercase characters converted to lowercase and vice versa.
Calls `str.swapcase` element-wise.
@@ -1487,11 +1506,12 @@ def swapcase(a):
Parameters
----------
- a : array-like of str or unicode
+ a : array_like, {str, unicode}
+ Input array.
Returns
-------
- out : ndarray
+ out : ndarray, {str, unicode}
Output array of str or unicode, depending on input type
See also
@@ -1506,14 +1526,16 @@ def swapcase(a):
>>> np.char.swapcase(c)
array(['A1b C', '1B cA', 'B cA1', 'Ca1B'],
dtype='|S5')
+
"""
a_arr = numpy.asarray(a)
return _vec_string(a_arr, a_arr.dtype, 'swapcase')
def title(a):
"""
- For each element in `a`, return a titlecased version of the
- string: words start with uppercase characters, all remaining cased
+ Return element-wise title cased version of string or unicode.
+
+ Title case words start with uppercase characters, all remaining cased
characters are lowercase.
Calls `str.title` element-wise.
@@ -1522,7 +1544,8 @@ def title(a):
Parameters
----------
- a : array-like of str or unicode
+ a : array_like, {str, unicode}
+ Input array.
Returns
-------
@@ -1541,6 +1564,7 @@ def title(a):
>>> np.char.title(c)
array(['A1B C', '1B Ca', 'B Ca1', 'Ca1B'],
dtype='|S5')
+
"""
a_arr = numpy.asarray(a)
return _vec_string(a_arr, a_arr.dtype, 'title')
@@ -1582,19 +1606,20 @@ def translate(a, table, deletechars=None):
def upper(a):
"""
- Return an array with the elements of `a` converted to uppercase.
+ Return an array with the elements converted to uppercase.
Calls `str.upper` element-wise.
For 8-bit strings, this method is locale-dependent.
Parameters
----------
- a : array-like of str or unicode
+ a : array_like, {str, unicode}
+ Input array.
Returns
-------
- out : ndarray
+ out : ndarray, {str, unicode}
Output array of str or unicode, depending on input type
See also
@@ -1609,30 +1634,33 @@ def upper(a):
>>> np.char.upper(c)
array(['A1B C', '1BCA', 'BCA1'],
dtype='|S5')
+
"""
a_arr = numpy.asarray(a)
return _vec_string(a_arr, a_arr.dtype, 'upper')
def zfill(a, width):
"""
- Return the numeric string left-filled with zeros in a string of
- length `width`.
+ Return the numeric string left-filled with zeros
Calls `str.zfill` element-wise.
Parameters
----------
- a : array-like of str or unicode
+ a : array_like, {str, unicode}
+ Input array.
width : int
+ Width of string to left-fill elements in `a`.
Returns
-------
- out : ndarray
+ out : ndarray, {str, unicode}
Output array of str or unicode, depending on input type
See also
--------
str.zfill
+
"""
a_arr = numpy.asarray(a)
width_arr = numpy.asarray(width)
@@ -1642,7 +1670,7 @@ def zfill(a, width):
def isnumeric(a):
"""
- For each element in `a`, return True if there are only numeric
+ For each element, return True if there are only numeric
characters in the element.
Calls `unicode.isnumeric` element-wise.
@@ -1653,24 +1681,26 @@ def isnumeric(a):
Parameters
----------
- a : array-like of unicode
+ a : array_like, unicode
+ Input array.
Returns
-------
- out : ndarray
- Array of booleans
+ out : ndarray, bool
+ Array of booleans of same shape as `a`.
See also
--------
unicode.isnumeric
+
"""
if _use_unicode(a) != unicode_:
raise TypeError("isnumeric is only available for Unicode strings and arrays")
return _vec_string(a, bool_, 'isnumeric')
def isdecimal(a):
"""
- For each element in `a`, return True if there are only decimal
+ For each element, return True if there are only decimal
characters in the element.
Calls `unicode.isdecimal` element-wise.
@@ -1681,16 +1711,18 @@ def isdecimal(a):
Parameters
----------
- a : array-like of unicode
+ a : array_like, unicode
+ Input array.
Returns
-------
- out : ndarray
- Array of booleans
+ out : ndarray, bool
+ Array of booleans identical in shape to `a`.
See also
--------
unicode.isdecimal
+
"""
if _use_unicode(a) != unicode_:
raise TypeError("isnumeric is only available for Unicode strings and arrays")
View
16 numpy/core/numeric.py
@@ -696,9 +696,10 @@ def correlate(a, v, mode='valid', old_behavior=False):
Refer to the `convolve` docstring. Note that the default
is `valid`, unlike `convolve`, which uses `full`.
old_behavior : bool
- If True, uses the old behavior from Numeric, (correlate(a,v) == correlate(v,
- a), and the conjugate is not taken for complex arrays). If False, uses
- the conventional signal processing definition (see note).
+ If True, uses the old behavior from Numeric,
+ (correlate(a,v) == correlate(v,a), and the conjugate is not taken
+ for complex arrays). If False, uses the conventional signal
+ processing definition.
See Also
--------
@@ -2344,7 +2345,14 @@ def setbufsize(size):
return old
def getbufsize():
- """Return the size of the buffer used in ufuncs.
+ """
+ Return the size of the buffer used in ufuncs.
+
+ Returns
+ -------
+ getbufsize : int
+ Size of ufunc buffer in bytes.
+
"""
return umath.geterrobj()[0]
View
6 numpy/core/shape_base.py
@@ -12,7 +12,7 @@ def atleast_1d(*arys):
Parameters
----------
- array1, array2, ... : array_like
+ arys1, arys2, ... : array_like
One or more input arrays.
Returns
@@ -61,7 +61,7 @@ def atleast_2d(*arys):
Parameters
----------
- array1, array2, ... : array_like
+ arys1, arys2, ... : array_like
One or more array-like sequences. Non-array inputs are converted
to arrays. Arrays that already have two or more dimensions are
preserved.
@@ -113,7 +113,7 @@ def atleast_3d(*arys):
Parameters
----------
- array1, array2, ... : array_like
+ arys1, arys2, ... : array_like
One or more array-like sequences. Non-array inputs are converted to
arrays. Arrays that already have three or more dimensions are
preserved.
View
16 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
View
18 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
View
3 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
-----
View
12 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
--------
View
81 numpy/linalg/linalg.py
@@ -250,15 +250,15 @@ def solve(a, b):
Parameters
----------
- a : array_like, shape (M, M)
+ a : (M, M) array_like
Coefficient matrix.
- b : array_like, shape (M,) or (M, N)
+ b : {(M,), (M, N)}, array_like
Ordinate or "dependent variable" values.
Returns
-------
- x : ndarray, shape (M,) or (M, N) depending on b
- Solution to the system a x = b
+ x : {(M,), (M, N)} ndarray
+ Solution to the system a x = b. Returned shape is identical to `b`.
Raises
------
@@ -410,12 +410,12 @@ def inv(a):
Parameters
----------
- a : array_like, shape (M, M)
+ a : (M, M) array_like
Matrix to be inverted.
Returns
-------
- ainv : ndarray or matrix, shape (M, M)
+ ainv : (M, M) ndarray or matrix
(Multiplicative) inverse of the matrix `a`.
Raises
@@ -459,14 +459,15 @@ def cholesky(a):
Parameters
----------
- a : array_like, shape (M, M)
+ a : (M, M) array_like
Hermitian (symmetric if all elements are real), positive-definite
input matrix.
Returns
-------
- L : ndarray, or matrix object if `a` is, shape (M, M)
- Lower-triangular Cholesky factor of a.
+ L : {(M, M) ndarray, (M, M) matrix}
+ Lower-triangular Cholesky factor of `a`. Returns a matrix object
+ if `a` is a matrix object.
Raises
------
@@ -709,12 +710,12 @@ def eigvals(a):
Parameters
----------
- a : array_like, shape (M, M)
+ a : (M, M) array_like
A complex- or real-valued matrix whose eigenvalues will be computed.
Returns
-------
- w : ndarray, shape (M,)
+ w : (M,) ndarray
The eigenvalues, each repeated according to its multiplicity.
They are not necessarily ordered, nor are they necessarily
real for real matrices.
@@ -815,7 +816,7 @@ def eigvalsh(a, UPLO='L'):
Parameters
----------
- a : array_like, shape (M, M)
+ a : (M, M) array_like
A complex- or real-valued matrix whose eigenvalues are to be
computed.
UPLO : {'L', 'U'}, optional
@@ -824,7 +825,7 @@ def eigvalsh(a, UPLO='L'):
Returns
-------
- w : ndarray, shape (M,)
+ w : (M,) ndarray
The eigenvalues, not necessarily ordered, each repeated according to
its multiplicity.
@@ -910,18 +911,17 @@ def eig(a):
Parameters
----------
- a : array_like, shape (M, M)
+ a : (M, M) array_like
A square array of real or complex elements.
Returns
-------
- w : ndarray, shape (M,)
+ w : (M,) ndarray
The eigenvalues, each repeated according to its multiplicity.
The eigenvalues are not necessarily ordered, nor are they
necessarily real for real arrays (though for real arrays
complex-valued eigenvalues should occur in conjugate pairs).
-
- v : ndarray, shape (M, M)
+ v : (M, M) ndarray
The normalized (unit "length") eigenvectors, such that the
column ``v[:,i]`` is the eigenvector corresponding to the
eigenvalue ``w[i]``.
@@ -1077,19 +1077,20 @@ def eigh(a, UPLO='L'):
Parameters
----------
- a : array_like, shape (M, M)
+ a : (M, M) array_like
A complex Hermitian or real symmetric matrix.
UPLO : {'L', 'U'}, optional
Specifies whether the calculation is done with the lower triangular
part of `a` ('L', default) or the upper triangular part ('U').
Returns
-------
- w : ndarray, shape (M,)
+ w : (M,) ndarray
The eigenvalues, not necessarily ordered.
- v : ndarray, or matrix object if `a` is, shape (M, M)
+ v : {(M, M) ndarray, (M, M) matrix}
The column ``v[:, i]`` is the normalized eigenvector corresponding
- to the eigenvalue ``w[i]``.
+ to the eigenvalue ``w[i]``. Will return a matrix object if `a` is
+ a matrix object.
Raises
------
@@ -1338,7 +1339,7 @@ def cond(x, p=None):
Parameters
----------
- x : array_like, shape (M, N)
+ x : (M, N) array_like
The matrix whose condition number is sought.
p : {None, 1, -1, 2, -2, inf, -inf, 'fro'}, optional
Order of the norm:
@@ -1424,9 +1425,9 @@ def matrix_rank(M, tol=None):
Parameters
----------
- M : array_like
+ M : {(M,), (M, N)} array_like
array of <=2 dimensions
- tol : {None, float}
+ tol : {None, float}, optional
threshold below which SVD values are considered zero. If `tol` is
None, and ``S`` is an array with singular values for `M`, and
``eps`` is the epsilon value for datatype of ``S``, then `tol` is
@@ -1489,7 +1490,7 @@ def pinv(a, rcond=1e-15 ):
Parameters
----------
- a : array_like, shape (M, N)
+ a : (M, N) array_like
Matrix to be pseudo-inverted.
rcond : float
Cutoff for small singular values.
@@ -1499,7 +1500,7 @@ def pinv(a, rcond=1e-15 ):
Returns
-------
- B : ndarray, shape (N, M)
+ B : (N, M) ndarray
The pseudo-inverse of `a`. If `a` is a `matrix` instance, then so
is `B`.
@@ -1647,14 +1648,19 @@ def det(a):
Parameters
----------
- a : array_like, shape (M, M)
+ a : (M, M) array_like
Input array.
Returns
-------
- det : ndarray
+ det : float
Determinant of `a`.
+ See Also
+ --------
+ slogdet : Another way to representing the determinant, more suitable
+ for large matrices where underflow/overflow may occur.
+
Notes
-----
The determinant is computed via LU factorization using the LAPACK
@@ -1668,11 +1674,6 @@ def det(a):
>>> np.linalg.det(a)
-2.0
- See Also
- --------
- slogdet : Another way to representing the determinant, more suitable
- for large matrices where underflow/overflow may occur.
-
"""
sign, logdet = slogdet(a)
return sign * exp(logdet)
@@ -1693,9 +1694,9 @@ def lstsq(a, b, rcond=-1):
Parameters
----------
- a : array_like, shape (M, N)
+ a : (M, N) array_like
"Coefficient" matrix.
- b : array_like, shape (M,) or (M, K)
+ b : {(M,), (M, K)} array_like
Ordinate or "dependent variable" values. If `b` is two-dimensional,
the least-squares solution is calculated for each of the `K` columns
of `b`.
@@ -1706,18 +1707,18 @@ def lstsq(a, b, rcond=-1):
Returns
-------
- x : ndarray, shape (N,) or (N, K)
+ x : {(M,), (M, K)} ndarray
Least-squares solution. The shape of `x` depends on the shape of
`b`.
- residues : ndarray, shape (), (1,), or (K,)
- Sums of residues; squared Euclidean 2-norm for each column in
+ residuals : {(), (1,), (K,)} ndarray
+ Sums of residuals; squared Euclidean 2-norm for each column in
``b - a*x``.
If the rank of `a` is < N or > M, this is an empty array.
If `b` is 1-dimensional, this is a (1,) shape array.
Otherwise the shape is (K,).
rank : int
Rank of matrix `a`.
- s : ndarray, shape (min(M,N),)
+ s : (min(M, N),) ndarray
Singular values of `a`.
Raises
@@ -1849,7 +1850,7 @@ def norm(x, ord=None):
Parameters
----------
- x : array_like, shape (M,) or (M, N)
+ x : {(M,), (M, N)} array_like
Input array.
ord : {non-zero int, inf, -inf, 'fro'}, optional
Order of the norm (see table under ``Notes``). inf means numpy's
View
5,305 numpy/random/mtrand/mtrand.c
3,052 additions, 2,253 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
26 numpy/random/mtrand/mtrand.pyx
@@ -2178,13 +2178,13 @@ cdef class RandomState:
References
----------
- ..[1] NIST/SEMATECH e-Handbook of Statistical Methods, "Cauchy
+ .. [1] NIST/SEMATECH e-Handbook of Statistical Methods, "Cauchy
Distribution",
http://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm
- ..[2] Weisstein, Eric W. "Cauchy Distribution." From MathWorld--A
+ .. [2] Weisstein, Eric W. "Cauchy Distribution." From MathWorld--A
Wolfram Web Resource.
http://mathworld.wolfram.com/CauchyDistribution.html
- ..[3] Wikipedia, "Cauchy distribution"
+ .. [3] Wikipedia, "Cauchy distribution"
http://en.wikipedia.org/wiki/Cauchy_distribution
Examples
@@ -2516,10 +2516,10 @@ cdef class RandomState:
See Also
--------
- scipy.stats.distributions.weibull : probability density function,
- distribution or cumulative density function, etc.
-
- gumbel, scipy.stats.distributions.genextreme
+ scipy.stats.distributions.weibull_max
+ scipy.stats.distributions.weibull_min
+ scipy.stats.distributions.genextreme
+ gumbel
Notes
-----
@@ -3159,9 +3159,9 @@ cdef class RandomState:
References
----------
- ..[1] Brighton Webs Ltd., Rayleigh Distribution,
+ .. [1] Brighton Webs Ltd., Rayleigh Distribution,
http://www.brighton-webs.co.uk/distributions/rayleigh.asp
- ..[2] Wikipedia, "Rayleigh distribution"
+ .. [2] Wikipedia, "Rayleigh distribution"
http://en.wikipedia.org/wiki/Rayleigh_distribution
Examples
@@ -3247,12 +3247,12 @@ cdef class RandomState:
References
----------
- ..[1] Brighton Webs Ltd., Wald Distribution,
+ .. [1] Brighton Webs Ltd., Wald Distribution,
http://www.brighton-webs.co.uk/distributions/wald.asp
- ..[2] Chhikara, Raj S., and Folks, J. Leroy, "The Inverse Gaussian
+ .. [2] Chhikara, Raj S., and Folks, J. Leroy, "The Inverse Gaussian
Distribution: Theory : Methodology, and Applications", CRC Press,
1988.
- ..[3] Wikipedia, "Wald distribution"
+ .. [3] Wikipedia, "Wald distribution"
http://en.wikipedia.org/wiki/Wald_distribution
Examples
@@ -3331,7 +3331,7 @@ cdef class RandomState:
References
----------
- ..[1] Wikipedia, "Triangular distribution"
+ .. [1] Wikipedia, "Triangular distribution"
http://en.wikipedia.org/wiki/Triangular_distribution
Examples
View
11 numpy/testing/nosetester.py
@@ -119,11 +119,12 @@ class NoseTester(object):
Notes
-----
- The default for `raise_warnings` is ``(DeprecationWarning, RuntimeWarning)``
- for the master branch of NumPy, and ``()`` for maintenance branches and
- released versions. The purpose of this switching behavior is to catch as
- many warnings as possible during development, but not give problems for
- packaging of released versions.
+ The default for `raise_warnings` is
+ ``(DeprecationWarning, RuntimeWarning)`` for the master branch of NumPy,
+ and ``()`` for maintenance branches and released versions. The purpose
+ of this switching behavior is to catch as many warnings as possible
+ during development, but not give problems for packaging of released
+ versions.
"""
# Stuff to exclude from tests. These are from numpy.distutils

0 comments on commit 436a28f

Please sign in to comment.