summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-08-17 19:18:56 -0700
committerCharles Harris <charlesr.harris@gmail.com>2011-08-27 07:26:56 -0600
commitbfda229ec93d37b1ee2cdd8b9443ec4e34536bbf (patch)
tree1315cce82b32c73eb9390e3fa46d8a8e0ddecebe /numpy/core/numeric.py
parentd9b3f90de3213ece9a78b77088fdec17910e81d9 (diff)
downloadnumpy-bfda229ec93d37b1ee2cdd8b9443ec4e34536bbf.tar.gz
ENH: missingdata: Create count_reduce_items function
This function either cheaply returns the product of the sizes of all the reduction axes, or counts the number of items which will be used in a reduction operation when skipna is True. Its purpose is to make it easy to do functions like np.mean and np.std.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index 9b7c20d76..00184505d 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -1,7 +1,7 @@
__all__ = ['newaxis', 'ndarray', 'flatiter', 'nditer', 'nested_iters', 'ufunc',
- 'arange', 'array', 'zeros', 'count_nonzero', 'empty', 'broadcast',
- 'dtype', 'fromstring', 'fromfile', 'frombuffer',
- 'int_asbuffer', 'where', 'argwhere', 'copyto',
+ 'arange', 'array', 'zeros', 'count_nonzero', 'count_reduce_items',
+ 'empty', 'broadcast', 'dtype', 'fromstring', 'fromfile',
+ 'frombuffer', 'int_asbuffer', 'where', 'argwhere', 'copyto',
'concatenate', 'fastCopyAndTranspose', 'lexsort', 'set_numeric_ops',
'can_cast', 'promote_types', 'min_scalar_type', 'result_type',
'asarray', 'asanyarray', 'ascontiguousarray', 'asfortranarray',
@@ -144,6 +144,7 @@ arange = multiarray.arange
array = multiarray.array
zeros = multiarray.zeros
count_nonzero = multiarray.count_nonzero
+count_reduce_items = multiarray.count_reduce_items
empty = multiarray.empty
empty_like = multiarray.empty_like
fromstring = multiarray.fromstring