summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorMark Wiebe <mwiebe@enthought.com>2011-07-29 17:57:46 -0500
committerCharles Harris <charlesr.harris@gmail.com>2011-08-27 07:26:49 -0600
commitc626f19a54624b3b66a1a7d77ef1ec90c1ff27cf (patch)
treefb9e6e1960fd4ff5c41516b151d0b017d48b3432 /numpy/core/numeric.py
parentaef8779c2f05327aa3c247222d0ef47532fadc39 (diff)
downloadnumpy-c626f19a54624b3b66a1a7d77ef1ec90c1ff27cf.tar.gz
ENH: missingdata: Fill in buffered NAMASK nditer, add maskna= to zeros, empty, and empty_like
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index a91535b35..f1e6b2da9 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -63,7 +63,7 @@ ufunc = type(sin)
# originally from Fernando Perez's IPython
-def zeros_like(a, dtype=None, order='K', subok=True):
+def zeros_like(a, dtype=None, order='K', subok=True, maskna=False):
"""
Return an array of zeros with the same shape and type as a given array.
@@ -81,6 +81,8 @@ def zeros_like(a, dtype=None, order='K', subok=True):
'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 : boolean
+ If this is true, the returned array will have an NA mask.
Returns
-------
@@ -113,7 +115,7 @@ def zeros_like(a, dtype=None, order='K', subok=True):
array([ 0., 0., 0.])
"""
- res = empty_like(a, dtype=dtype, order=order, subok=subok)
+ res = empty_like(a, dtype=dtype, order=order, subok=subok, maskna=maskna)
multiarray.copyto(res, 0, casting='unsafe')
return res