From 987cd0c2e6e2c8a73917e0bee19f869058c3b20f Mon Sep 17 00:00:00 2001 From: MechCoder Date: Thu, 7 Apr 2016 12:25:02 -0400 Subject: [PATCH] DOC: Fix order='A' docs of np.array --- numpy/add_newdocs.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py index 16799887fabc..269c17adfa5d 100644 --- a/numpy/add_newdocs.py +++ b/numpy/add_newdocs.py @@ -647,7 +647,7 @@ def luf(lamdaexpr, *args, **kwargs): add_newdoc('numpy.core.multiarray', 'array', """ - array(object, dtype=None, copy=True, order=None, subok=False, ndmin=0) + array(object, dtype=None, copy=True, order='K', subok=False, ndmin=0) Create an array. @@ -668,14 +668,18 @@ def luf(lamdaexpr, *args, **kwargs): will only be made if __array__ returns a copy, if obj is a nested sequence, or if a copy is needed to satisfy any of the other requirements (`dtype`, `order`, etc.). - order : {'C', 'F', 'A'}, optional + order : {'C', 'F', 'A', 'K'}, optional, default 'K' Specify the order of the array. If order is 'C', then the array will be in C-contiguous order (last-index varies the fastest). If order is 'F', then the returned array will be in Fortran-contiguous order (first-index varies the fastest). - If order is 'A' (default), then the returned array may be - in any order (either C-, Fortran-contiguous, or even discontiguous), - unless a copy is required, in which case it will be C-contiguous. + If ``copy=False``, and order is set to 'A' or 'K', nothing + is ensured about the memory layout of the output array. + If ``copy=True`` and + - Order is 'A', then the order of the output is C + unless the input is fortran-ordered. + - Order is 'K', then the memory layout of the returned array is + kept as close as possible to the original array. subok : bool, optional If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (default).