summaryrefslogtreecommitdiff
path: root/numpy/_array_api/_statistical_functions.py
diff options
context:
space:
mode:
authorAaron Meurer <asmeurer@gmail.com>2021-01-12 12:34:59 -0700
committerAaron Meurer <asmeurer@gmail.com>2021-01-12 12:34:59 -0700
commit9578636259f86267c2253f4af2510ce1eeaf084c (patch)
treef140af373c657aa2d3d107dd6504910bc5a47702 /numpy/_array_api/_statistical_functions.py
parentd9651020aa9e1f6211b920954a357ac45712938d (diff)
downloadnumpy-9578636259f86267c2253f4af2510ce1eeaf084c.tar.gz
Make the array_api submodules private, and remove __all__ from individual files
The specific submodule organization is an implementation detail and should not be used. Only the top-level numpy._array_api namespace should be used.
Diffstat (limited to 'numpy/_array_api/_statistical_functions.py')
-rw-r--r--numpy/_array_api/_statistical_functions.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/numpy/_array_api/_statistical_functions.py b/numpy/_array_api/_statistical_functions.py
new file mode 100644
index 000000000..339835095
--- /dev/null
+++ b/numpy/_array_api/_statistical_functions.py
@@ -0,0 +1,29 @@
+def max(x, /, *, axis=None, keepdims=False):
+ from .. import max
+ return max(x, axis=axis, keepdims=keepdims)
+
+def mean(x, /, *, axis=None, keepdims=False):
+ from .. import mean
+ return mean(x, axis=axis, keepdims=keepdims)
+
+def min(x, /, *, axis=None, keepdims=False):
+ from .. import min
+ return min(x, axis=axis, keepdims=keepdims)
+
+def prod(x, /, *, axis=None, keepdims=False):
+ from .. import prod
+ return prod(x, axis=axis, keepdims=keepdims)
+
+def std(x, /, *, axis=None, correction=0.0, keepdims=False):
+ from .. import std
+ # Note: the keyword argument correction is different here
+ return std(x, axis=axis, ddof=correction, keepdims=keepdims)
+
+def sum(x, /, *, axis=None, keepdims=False):
+ from .. import sum
+ return sum(x, axis=axis, keepdims=keepdims)
+
+def var(x, /, *, axis=None, correction=0.0, keepdims=False):
+ from .. import var
+ # Note: the keyword argument correction is different here
+ return var(x, axis=axis, ddof=correction, keepdims=keepdims)