summaryrefslogtreecommitdiff
path: root/numpy/add_newdocs.py
diff options
context:
space:
mode:
authorrgommers <ralf.gommers@googlemail.com>2011-03-02 12:43:47 +0800
committerrgommers <ralf.gommers@googlemail.com>2011-03-02 13:23:48 +0800
commit4ca2465fe169576b46dee783dd0279cfd536d9c4 (patch)
treed682c1b79e51bb52dd5493337facf2afc5dbca76 /numpy/add_newdocs.py
parent7ef5d601b4fe281c797fa497c317861c7340e3ec (diff)
downloadnumpy-4ca2465fe169576b46dee783dd0279cfd536d9c4.tar.gz
DOC: merge more doc wiki edits.
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r--numpy/add_newdocs.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 5b65d9ce1..62e656346 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -2605,9 +2605,15 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('astype',
Parameters
----------
- t : string or dtype
+ t : str or dtype
Typecode or data-type to which the array is cast.
+ Raises
+ ------
+ ComplexWarning :
+ When casting from complex to float or int. To avoid this,
+ one should use ``a.real.astype(t)``.
+
Examples
--------
>>> x = np.array([1, 2, 2.5])
@@ -4297,8 +4303,9 @@ add_newdoc('numpy.lib._compiled_base', 'bincount',
Input array.
weights : array_like, optional
Weights, array of the same shape as `x`.
- minlength : integer, optional
+ minlength : int, optional
.. versionadded:: 1.6.0
+
A minimum number of bins for the output array.
Returns
@@ -4330,6 +4337,9 @@ add_newdoc('numpy.lib._compiled_base', 'bincount',
>>> np.bincount(x).size == np.amax(x)+1
True
+ The input array needs to be of integer dtype, otherwise a
+ TypeError is raised:
+
>>> np.bincount(np.arange(5, dtype=np.float))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>