diff options
author | Mark Wiebe <mwwiebe@gmail.com> | 2011-08-22 14:01:55 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-08-27 07:26:59 -0600 |
commit | 0e1a4e9525b2c1e4abae97a6927cf59b5b2d534b (patch) | |
tree | 9eb3c920de5dbe2eb1de5580a826ab047705a402 /numpy/lib/function_base.py | |
parent | 976476081b78279154950d2392aff8ee9290b60f (diff) | |
download | numpy-0e1a4e9525b2c1e4abae97a6927cf59b5b2d534b.tar.gz |
ENH: missingdata: Add maskna= parameter to np.copy and ndarray.copy
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 411a86955..b269d98a1 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): +def copy(a, order='C', maskna=None): """ Return an array copy of the given object. @@ -786,6 +786,15 @@ def copy(a): ---------- a : array_like Input data. + order : {'C', 'F', 'A', 'K'}, optional + 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. + maskna : bool, optional + If specifies, forces the copy to have or to not have an + NA mask. This is a way to remove an NA mask from an array + while making a copy. Returns ------- @@ -815,7 +824,7 @@ def copy(a): False """ - return array(a, copy=True) + return array(a, order=order, copy=True, maskna=maskna) # Basic operations |