summaryrefslogtreecommitdiff
path: root/numpy/add_newdocs.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r--numpy/add_newdocs.py61
1 files changed, 14 insertions, 47 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 64309721c..0a48f1ade 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -2174,43 +2174,6 @@ add_newdoc('numpy.core', 'einsum',
""")
-add_newdoc('numpy.core', 'alterdot',
- """
- Change `dot`, `vdot`, and `inner` to use accelerated BLAS functions.
-
- Typically, as a user of Numpy, you do not explicitly call this function. If
- Numpy is built with an accelerated BLAS, this function is automatically
- called when Numpy is imported.
-
- When Numpy is built with an accelerated BLAS like ATLAS, these functions
- are replaced to make use of the faster implementations. The faster
- implementations only affect float32, float64, complex64, and complex128
- arrays. Furthermore, the BLAS API only includes matrix-matrix,
- matrix-vector, and vector-vector products. Products of arrays with larger
- dimensionalities use the built in functions and are not accelerated.
-
- See Also
- --------
- restoredot : `restoredot` undoes the effects of `alterdot`.
-
- """)
-
-add_newdoc('numpy.core', 'restoredot',
- """
- Restore `dot`, `vdot`, and `innerproduct` to the default non-BLAS
- implementations.
-
- Typically, the user will only need to call this when troubleshooting and
- installation problem, reproducing the conditions of a build without an
- accelerated BLAS, or when being very careful about benchmarking linear
- algebra operations.
-
- See Also
- --------
- alterdot : `restoredot` undoes the effects of `alterdot`.
-
- """)
-
add_newdoc('numpy.core', 'vdot',
"""
vdot(a, b)
@@ -4451,12 +4414,12 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('tolist',
tobytesdoc = """
- a.tostring(order='C')
+ a.{name}(order='C')
- Construct a Python string containing the raw data bytes in the array.
+ Construct Python bytes containing the raw data bytes in the array.
- Constructs a Python string showing a copy of the raw contents of
- data memory. The string can be produced in either 'C' or 'Fortran',
+ Constructs Python bytes showing a copy of the raw contents of
+ data memory. The bytes object can be produced in either 'C' or 'Fortran',
or 'Any' order (the default is 'C'-order). 'Any' order means C-order
unless the F_CONTIGUOUS flag in the array is set, in which case it
means 'Fortran' order.
@@ -4471,29 +4434,31 @@ tobytesdoc = """
Returns
-------
- s : str
- A Python string exhibiting a copy of `a`'s raw data.
+ s : bytes
+ Python bytes exhibiting a copy of `a`'s raw data.
Examples
--------
>>> x = np.array([[0, 1], [2, 3]])
>>> x.tobytes()
- '\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x03\\x00\\x00\\x00'
+ b'\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x03\\x00\\x00\\x00'
>>> x.tobytes('C') == x.tobytes()
True
>>> x.tobytes('F')
- '\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x03\\x00\\x00\\x00'
+ b'\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x03\\x00\\x00\\x00'
"""
add_newdoc('numpy.core.multiarray', 'ndarray',
- ('tostring', tobytesdoc.format(deprecated=
+ ('tostring', tobytesdoc.format(name='tostring',
+ deprecated=
'This function is a compatibility '
'alias for tobytes. Despite its '
'name it returns bytes not '
'strings.')))
add_newdoc('numpy.core.multiarray', 'ndarray',
- ('tobytes', tobytesdoc.format(deprecated='.. versionadded:: 1.9.0')))
+ ('tobytes', tobytesdoc.format(name='tobytes',
+ deprecated='.. versionadded:: 1.9.0')))
add_newdoc('numpy.core.multiarray', 'ndarray', ('trace',
"""
@@ -5511,6 +5476,8 @@ add_newdoc('numpy.core', 'ufunc', ('reduce',
in the result as dimensions with size one. With this option,
the result will broadcast correctly against the original `arr`.
+ .. versionadded:: 1.7.0
+
Returns
-------
r : ndarray