From f0e6e0143c4a43e0bb9dcad7c567ffaa51d7a281 Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Wed, 23 Oct 2013 21:26:47 +0200 Subject: ENH: keep order in np.sort and np.partition copy avoids unnecessary strided to contig copy for fortran arrays. --- numpy/core/fromnumeric.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/core/fromnumeric.py') diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index abfa99e80..152cceb1b 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -615,7 +615,7 @@ def partition(a, kth, axis=-1, kind='introselect', order=None): a = asanyarray(a).flatten() axis = 0 else: - a = asanyarray(a).copy() + a = asanyarray(a).copy(order="K") a.partition(kth, axis=axis, kind=kind, order=order) return a @@ -784,7 +784,7 @@ def sort(a, axis=-1, kind='quicksort', order=None): a = asanyarray(a).flatten() axis = 0 else: - a = asanyarray(a).copy() + a = asanyarray(a).copy(order="K") a.sort(axis, kind, order) return a -- cgit v1.2.1