summaryrefslogtreecommitdiff
path: root/numpy/core/_asarray.py
diff options
context:
space:
mode:
authorNeal C <nealchau@gmail.com>2020-07-14 00:44:56 -0700
committerGitHub <noreply@github.com>2020-07-14 10:44:56 +0300
commitf31f12afa6fcbc852dfc57b34dd701d7b4145203 (patch)
tree81bd2558ad7b91c2af5dfb219ed74247f3f534ae /numpy/core/_asarray.py
parent197093bd7a455ce285b2415e45039cab83544269 (diff)
downloadnumpy-f31f12afa6fcbc852dfc57b34dd701d7b4145203.tar.gz
DOC: Add explanation of 'K' and 'A' layout options to 'asarray*' functions (#16811)
* DOC: update parameter choices for asarray, asarray_contiguous, asarray_chkfinite converters Co-authored-by: sun <sun@vosdbt.org>
Diffstat (limited to 'numpy/core/_asarray.py')
-rw-r--r--numpy/core/_asarray.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/numpy/core/_asarray.py b/numpy/core/_asarray.py
index df569f22d..1b06c328f 100644
--- a/numpy/core/_asarray.py
+++ b/numpy/core/_asarray.py
@@ -23,9 +23,12 @@ def asarray(a, dtype=None, order=None):
of lists and ndarrays.
dtype : data-type, optional
By default, the data-type is inferred from the input data.
- order : {'C', 'F'}, optional
- Whether to use row-major (C-style) or
- column-major (Fortran-style) memory representation.
+ order : {'C', 'F', 'A', 'K'}, optional
+ Memory layout. 'A' and 'K' depend on the order of input array a.
+ 'C' row-major (C-style),
+ 'F' column-major (Fortran-style) memory representation.
+ 'A' (any) means 'F' if `a` is Fortran contiguous, 'C' otherwise
+ 'K' (keep) preserve input order
Defaults to 'C'.
Returns
@@ -95,9 +98,13 @@ def asanyarray(a, dtype=None, order=None):
tuples of lists, and ndarrays.
dtype : data-type, optional
By default, the data-type is inferred from the input data.
- order : {'C', 'F'}, optional
- Whether to use row-major (C-style) or column-major
- (Fortran-style) memory representation. Defaults to 'C'.
+ order : {'C', 'F', 'A', 'K'}, optional
+ Memory layout. 'A' and 'K' depend on the order of input array a.
+ 'C' row-major (C-style),
+ 'F' column-major (Fortran-style) memory representation.
+ 'A' (any) means 'F' if `a` is Fortran contiguous, 'C' otherwise
+ 'K' (keep) preserve input order
+ Defaults to 'C'.
Returns
-------