summaryrefslogtreecommitdiff
path: root/numpy/_array_api/_statistical_functions.py
blob: 833c47f6602d8bc382787c9607c57938045af24b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import numpy as np

def max(x, /, *, axis=None, keepdims=False):
    return np.max(x, axis=axis, keepdims=keepdims)

def mean(x, /, *, axis=None, keepdims=False):
    return np.mean(x, axis=axis, keepdims=keepdims)

def min(x, /, *, axis=None, keepdims=False):
    return np.min(x, axis=axis, keepdims=keepdims)

def prod(x, /, *, axis=None, keepdims=False):
    return np.prod(x, axis=axis, keepdims=keepdims)

def std(x, /, *, axis=None, correction=0.0, keepdims=False):
    # Note: the keyword argument correction is different here
    return np.std(x, axis=axis, ddof=correction, keepdims=keepdims)

def sum(x, /, *, axis=None, keepdims=False):
    return np.sum(x, axis=axis, keepdims=keepdims)

def var(x, /, *, axis=None, correction=0.0, keepdims=False):
    # Note: the keyword argument correction is different here
    return np.var(x, axis=axis, ddof=correction, keepdims=keepdims)