Skip to content

Add statistical function specifications #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Aug 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add min and max
  • Loading branch information
kgryte committed Aug 12, 2020
commit 70090ac760df8efde4e289216cb312899b47acbb
60 changes: 58 additions & 2 deletions spec/API_specification/statistical_reductions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,34 @@ A conforming implementation of the array API standard must provide and support t

<!-- NOTE: please keep the functions in alphabetical order -->

### <a name="max" href="#max">#</a> max(x, /, *, axis=None, keepdims=False, out=None)

Calculates the maximum value of the input array `x`.

#### Parameters

- **x**: _&lt;array&gt;_

- input array.

- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_

- axis or axes along which maximum values must be computed. By default, the maximum value must be computed over the entire array. If a tuple of integers, maximum values must be computed over multiple axes. Default: `None`.

- **keepdims**: _bool_

- If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array. Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`.

- **out**: _Optional\[ &lt;array&gt; ]_

- output array. If provided, the output array must have the expected output shape. If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each computation. Default: `None`.

#### Returns

- **out**: _Union\[ int, float, &lt;array&gt; ]_

- if the maximum value was computed over the entire array, the maximum value; otherwise, an array containing the maximum values.

### <a name="mean" href="#mean">#</a> mean(x, /, *, axis=None, keepdims=False, out=None)

Calculates the arithmetic mean of the input array `x`.
Expand All @@ -26,7 +54,7 @@ Calculates the arithmetic mean of the input array `x`.

- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_

- axis or axes along which the mean must be computed. By default, the mean must be computed over the entire array. If a tuple of integers, the mean must be computed over multiple axes. Default: `None`.
- axis or axes along which arithmetic means must be computed. By default, the mean must be computed over the entire array. If a tuple of integers, arithmetic means must be computed over multiple axes. Default: `None`.

- **keepdims**: _bool_

Expand All @@ -40,4 +68,32 @@ Calculates the arithmetic mean of the input array `x`.

- **out**: _Union\[ float, &lt;array&gt; ]_

- if the arithmetic mean was computed over the entire array, the arithmetic mean; otherwise, an array containing the arithmetic means.
- if the arithmetic mean was computed over the entire array, the arithmetic mean; otherwise, an array containing the arithmetic means.

### <a name="min" href="#min">#</a> min(x, /, *, axis=None, keepdims=False, out=None)

Calculates the minimum value of the input array `x`.

#### Parameters

- **x**: _&lt;array&gt;_

- input array.

- **axis**: _Optional\[ Union\[ int, Tuple\[ int, ... ] ] ]_

- axis or axes along which minimum values must be computed. By default, the minimum value must be computed over the entire array. If a tuple of integers, minimum values must be computed over multiple axes. Default: `None`.

- **keepdims**: _bool_

- If `True`, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array. Otherwise, if `False`, the reduced axes (dimensions) must not be included in the result. Default: `False`.

- **out**: _Optional\[ &lt;array&gt; ]_

- output array. If provided, the output array must have the expected output shape. If not provided or is `None`, an uninitialized return array must be created and then filled with the result of each computation. Default: `None`.

#### Returns

- **out**: _Union\[ int, float, &lt;array&gt; ]_

- if the minimum value was computed over the entire array, the minimum value; otherwise, an array containing the minimum values.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy