Skip to content

Commit

Permalink
DOC: merge wiki edits. Add percentile to statistics routines (ML sugg…
Browse files Browse the repository at this point in the history
…estion).
  • Loading branch information
rgommers committed Jul 7, 2012
1 parent 3445712 commit 2c9981b
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 37 deletions.
1 change: 1 addition & 0 deletions doc/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ NumPy Reference
:Release: |version|
:Date: |today|


.. module:: numpy

This reference manual details functions, modules, and objects
Expand Down
5 changes: 3 additions & 2 deletions doc/source/reference/routines.statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Statistics
.. currentmodule:: numpy


Extremal values
---------------
Order statistics
----------------

.. autosummary::
:toctree: generated/
Expand All @@ -15,6 +15,7 @@ Extremal values
nanmin
nanmax
ptp
percentile

Averages and variances
----------------------
Expand Down
22 changes: 17 additions & 5 deletions numpy/add_newdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
""")

Expand Down Expand Up @@ -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
Expand Down
16 changes: 12 additions & 4 deletions numpy/core/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down Expand Up @@ -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]

Expand Down
6 changes: 3 additions & 3 deletions numpy/core/shape_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def atleast_1d(*arys):
Parameters
----------
array1, array2, ... : array_like
arys1, arys2, ... : array_like
One or more input arrays.
Returns
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions numpy/lib/function_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,9 +1316,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`.
Expand Down
3 changes: 1 addition & 2 deletions numpy/lib/npyio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
26 changes: 13 additions & 13 deletions numpy/random/mtrand/mtrand.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
-----
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -3331,7 +3331,7 @@ cdef class RandomState:
References
----------
..[1] Wikipedia, "Triangular distribution"
.. [1] Wikipedia, "Triangular distribution"
http://en.wikipedia.org/wiki/Triangular_distribution
Examples
Expand Down
11 changes: 6 additions & 5 deletions numpy/testing/nosetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c9981b

Please sign in to comment.