diff options
author | Nathaniel J. Smith <njs@pobox.com> | 2012-10-01 17:36:01 +0100 |
---|---|---|
committer | Nathaniel J. Smith <njs@pobox.com> | 2012-10-01 17:36:01 +0100 |
commit | 1a71edc55b227e590022d402e5b6558d3a9921f1 (patch) | |
tree | aebff885c98c49db41eebf18d718d6e9840d0536 /numpy/lib/function_base.py | |
parent | e18e7441700db0ff2fd8f51901aa416c63e35cbc (diff) | |
download | numpy-1a71edc55b227e590022d402e5b6558d3a9921f1.tar.gz |
[FIX] preserve memory order in np.copy()
This switches us back to the behaviour seen in numpy 1.6 and earlier,
which it turns out that scikit-learn (and probably others) relied on.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index e32492958..65f4ecb05 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -778,7 +778,7 @@ def select(condlist, choicelist, default=0): S = S*ones(asarray(pfac).shape, S.dtype) return choose(S, tuple(choicelist)) -def copy(a, order='C'): +def copy(a, order='K'): """ Return an array copy of the given object. @@ -790,7 +790,9 @@ def copy(a, order='C'): 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. + as possible. (Note that this function and :meth:ndarray.copy are very + similar, but have different default values for their order= + arguments.) Returns ------- |