@@ -8616,7 +8616,7 @@ def asarray(a, dtype=None, order=None):
86168616 subok = False , order = order )
86178617
86188618
8619- def asanyarray (a , dtype = None , order = 'A' ):
8619+ def asanyarray (a , dtype = None , order = None ):
86208620 """
86218621 Convert the input to a masked array, conserving subclasses.
86228622
@@ -8629,14 +8629,13 @@ def asanyarray(a, dtype=None, order='A'):
86298629 Input data, in any form that can be converted to an array.
86308630 dtype : dtype, optional
86318631 By default, the data-type is inferred from the input data.
8632- order : {'C', 'F', 'A'}, optional
8633- Specify the order of the array. If order is 'C', then the array
8634- will be in C-contiguous order (last-index varies the fastest).
8635- If order is 'F', then the returned array will be in
8636- Fortran-contiguous order (first-index varies the fastest).
8637- If order is 'A' (default), then the returned array may be
8638- in any order (either C-, Fortran-contiguous, or even discontiguous),
8639- unless a copy is required, in which case it will be C-contiguous.
8632+ order : {'C', 'F', 'A', 'K'}, optional
8633+ Memory layout. 'A' and 'K' depend on the order of input array ``a``.
8634+ 'C' row-major (C-style),
8635+ 'F' column-major (Fortran-style) memory representation.
8636+ 'A' (any) means 'F' if ``a`` is Fortran contiguous, 'C' otherwise
8637+ 'K' (keep) preserve input order
8638+ Defaults to 'K'.
86408639
86418640 Returns
86428641 -------
@@ -8670,7 +8669,7 @@ def asanyarray(a, dtype=None, order='A'):
86708669 isinstance (a , MaskedArray )
86718670 and (dtype is None or dtype == a .dtype )
86728671 and (
8673- order == 'A'
8672+ order in { None , 'A' , 'K' }
86748673 or order == 'C' and a .flags .carray
86758674 or order == 'F' and a .flags .f_contiguous
86768675 )
0 commit comments