summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorabhilash42 <abhilash.ub@gmail.com>2020-05-19 00:56:30 +0530
committerabhilash42 <abhilash.ub@gmail.com>2020-05-19 00:56:30 +0530
commit91f147091316595be3b875ca9de2361666318370 (patch)
tree76f672597268027764e4ec2ecb5dd6ca1bcc82e9 /numpy
parent625f3345189ed4742ecde22d569398062d4743d2 (diff)
downloadnumpy-91f147091316595be3b875ca9de2361666318370.tar.gz
Update _add_newdocs.py
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/_add_newdocs.py24
1 files changed, 8 insertions, 16 deletions
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py
index 1343c6bc3..85b19091d 100644
--- a/numpy/core/_add_newdocs.py
+++ b/numpy/core/_add_newdocs.py
@@ -3938,23 +3938,19 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('tobytes', """
Construct Python bytes containing the raw data bytes in the array.
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 'K' or 'A' order (the default is 'C'-order). 'A' order means C-order
- unless the F_CONTIGUOUS flag in the array is set, in which case it
- means 'Fortran' order. 'K' order is as close to the order array elements appear
- in memory.
+ data memory. The bytes object can be produced in C-order by default.
+ This behavior is controlled by the order parameter.
.. versionadded:: 1.9.0
Parameters
----------
- order : {'C', 'F', None}, optional
- Order of the data for multidimensional arrays:
- 'C' means it should be C contiguous,
- 'F' means it should be Fortran contiguous,
- 'A' means it should be 'F' if the inputs are all 'F', 'C' otherwise.
- 'K' means it should be as close to the layout of the inputs as
- is possible, including arbitrarily permuted axes.
+ order : {'C', 'F', 'A', 'K'}, optional
+ Controls the memory layout of the copy. 'C' means C-order,
+ 'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous,
+ 'C' otherwise. 'K' means match the layout of `a` as closely
+ as possible.
+ Default is 'C'.
Returns
-------
@@ -3970,10 +3966,6 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('tobytes', """
True
>>> x.tobytes('F')
b'\\x00\\x00\\x02\\x00\\x01\\x00\\x03\\x00'
- >>> x.tobytes('A') == x.tobytes()
- True
- >>> x.tobytes('K') == x.tobytes()
- True
"""))