From 3f43f97b1d8d44aa7d5b60e129202c2c9c714c54 Mon Sep 17 00:00:00 2001 From: Stephannie Jimenez Date: Wed, 19 Jan 2022 14:32:03 -0500 Subject: [PATCH 1/2] Transform set functions md to rst --- spec/API_specification/set_functions.md | 168 ------------------ spec/API_specification/set_functions.rst | 26 +++ .../signatures/set_functions.py | 135 ++++++++++++++ 3 files changed, 161 insertions(+), 168 deletions(-) delete mode 100644 spec/API_specification/set_functions.md create mode 100644 spec/API_specification/set_functions.rst create mode 100644 spec/API_specification/signatures/set_functions.py diff --git a/spec/API_specification/set_functions.md b/spec/API_specification/set_functions.md deleted file mode 100644 index efffef125..000000000 --- a/spec/API_specification/set_functions.md +++ /dev/null @@ -1,168 +0,0 @@ -# Set Functions - -> Array API specification for creating and operating on sets. - -A conforming implementation of the array API standard must provide and support the following functions adhering to the following conventions. - -- Positional parameters must be [positional-only](https://www.python.org/dev/peps/pep-0570/) parameters. Positional-only parameters have no externally-usable name. When a function accepting positional-only parameters is called, positional arguments are mapped to these parameters based solely on their order. -- Optional parameters must be [keyword-only](https://www.python.org/dev/peps/pep-3102/) arguments. -- Unless stated otherwise, functions must support the data types defined in {ref}`data-types`. - -## Objects in API - - - -(function-unique-all)= -### unique_all(x, /) - -:::{admonition} Data-dependent output shape -:class: important - -The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See {ref}`data-dependent-output-shapes` section for more details. -::: - -Returns the unique elements of an input array `x`, the first occurring indices for each unique element in `x`, the indices from the set of unique elements that reconstruct `x`, and the corresponding counts for each unique element in `x`. - -```{note} -Uniqueness should be determined based on value equality (i.e., `x_i == x_j`). For input arrays having floating-point data types, value-based equality implies the following behavior. - -- As `nan` values compare as `False`, `nan` values should be considered distinct. -- As `-0` and `+0` compare as `True`, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return `-0` if `-0` occurs before `+0`). - -As signed zeros are not distinct, using `inverse_indices` to reconstruct the input array is not guaranteed to return an array having the exact same values. - -Each `nan` value should have a count of one, while the counts for signed zeros should be aggregated as a single count. -``` - -#### Parameters - -- **x**: _<array>_ - - - input array. If `x` has more than one dimension, the function must flatten `x` and return the unique elements of the flattened array. - -#### Returns - -- **out**: _Tuple\[ <array>, <array>, <array>, <array> ]_ - - - a namedtuple `(values, indices, inverse_indices, counts)` whose - - - first element must have the field name `values` and must be an array containing the unique elements of `x`. The array must have the same data type as `x`. - - second element must have the field name `indices` and must be an array containing the indices (first occurrences) of `x` that result in `values`. The array must have the same shape as `values` and must have the default array index data type. - - third element must have the field name `inverse_indices` and must be an array containing the indices of `values` that reconstruct `x`. The array must have the same shape as `x` and must have the default array index data type. - - fourth element must have the field name `counts` and must be an array containing the number of times each unique element occurs in `x`. The returned array must have same shape as `values` and must have the default array index data type. - - ```{note} - The order of unique elements is not specified and may vary between implementations. - ``` - -(function-unique-counts)= -### unique_counts(x, /) - -:::{admonition} Data-dependent output shape -:class: important - -The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See {ref}`data-dependent-output-shapes` section for more details. -::: - -Returns the unique elements of an input array `x` and the corresponding counts for each unique element in `x`. - -```{note} -Uniqueness should be determined based on value equality (i.e., `x_i == x_j`). For input arrays having floating-point data types, value-based equality implies the following behavior. - -- As `nan` values compare as `False`, `nan` values should be considered distinct. -- As `-0` and `+0` compare as `True`, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return `-0` if `-0` occurs before `+0`). - -Each `nan` value should have a count of one, while the counts for signed zeros should be aggregated as a single count. -``` - -#### Parameters - -- **x**: _<array>_ - - - input array. If `x` has more than one dimension, the function must flatten `x` and return the unique elements of the flattened array. - -#### Returns - -- **out**: _Tuple\[ <array>, <array> ]_ - - - a namedtuple `(values, counts)` whose - - - first element must have the field name `values` and must be an array containing the unique elements of `x`. The array must have the same data type as `x`. - - second element must have the field name `counts` and must be an array containing the number of times each unique element occurs in `x`. The returned array must have same shape as `values` and must have the default array index data type. - - ```{note} - The order of unique elements is not specified and may vary between implementations. - ``` - -(function-unique-inverse)= -### unique_inverse(x, /) - -:::{admonition} Data-dependent output shape -:class: important - -The shape of one of the output arrays for this function depends on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See {ref}`data-dependent-output-shapes` section for more details. -::: - -Returns the unique elements of an input array `x` and the indices from the set of unique elements that reconstruct `x`. - -```{note} -Uniqueness should be determined based on value equality (i.e., `x_i == x_j`). For input arrays having floating-point data types, value-based equality implies the following behavior. - -- As `nan` values compare as `False`, `nan` values should be considered distinct. -- As `-0` and `+0` compare as `True`, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return `-0` if `-0` occurs before `+0`). - -As signed zeros are not distinct, using `inverse_indices` to reconstruct the input array is not guaranteed to return an array having the exact same values. -``` - -#### Parameters - -- **x**: _<array>_ - - - input array. If `x` has more than one dimension, the function must flatten `x` and return the unique elements of the flattened array. - -#### Returns - -- **out**: _Tuple\[ <array>, <array> ]_ - - - a namedtuple `(values, inverse_indices)` whose - - - first element must have the field name `values` and must be an array containing the unique elements of `x`. The array must have the same data type as `x`. - - second element must have the field name `inverse_indices` and must be an array containing the indices of `values` that reconstruct `x`. The array must have the same shape as `x` and have the default array index data type. - - ```{note} - The order of unique elements is not specified and may vary between implementations. - ``` - -(function-unique-values)= -### unique_values(x, /) - -:::{admonition} Data-dependent output shape -:class: important - -The shape of the output array for this function depends on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See {ref}`data-dependent-output-shapes` section for more details. -::: - -Returns the unique elements of an input array `x`. - -```{note} -Uniqueness should be determined based on value equality (i.e., `x_i == x_j`). For input arrays having floating-point data types, value-based equality implies the following behavior. - -- As `nan` values compare as `False`, `nan` values should be considered distinct. -- As `-0` and `+0` compare as `True`, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return `-0` if `-0` occurs before `+0`). -``` - -#### Parameters - -- **x**: _<array>_ - - - input array. If `x` has more than one dimension, the function must flatten `x` and return the unique elements of the flattened array. - -#### Returns - -- **out**: _<array>_ - - - an array containing the set of unique elements in `x`. The returned array must have the same data type as `x`. - - ```{note} - The order of unique elements is not specified and may vary between implementations. - ``` diff --git a/spec/API_specification/set_functions.rst b/spec/API_specification/set_functions.rst new file mode 100644 index 000000000..1f287fece --- /dev/null +++ b/spec/API_specification/set_functions.rst @@ -0,0 +1,26 @@ +Set Functions +============= + + Array API specification for creating and operating on sets. + +A conforming implementation of the array API standard must provide and support the following functions adhering to the following conventions. + +- Positional parameters must be `positional-only `_ parameters. Positional-only parameters have no externally-usable name. When a function accepting positional-only parameters is called, positional arguments are mapped to these parameters based solely on their order. +- Optional parameters must be `keyword-only `_ arguments. +- Unless stated otherwise, functions must support the data types defined in :ref:`data-types`. + +Objects in API +-------------- + +.. currentmodule:: signatures.set_functions + +.. + NOTE: please keep the functions in alphabetical order + +.. autosummary:: + :toctree: generated + + unique_all + unique_counts + unique_inverse + unique_values diff --git a/spec/API_specification/signatures/set_functions.py b/spec/API_specification/signatures/set_functions.py new file mode 100644 index 000000000..687acc3ab --- /dev/null +++ b/spec/API_specification/signatures/set_functions.py @@ -0,0 +1,135 @@ +from ._types import Tuple, array + +def unique_all(x: array, /) -> Tuple[array, array, array, array]: + """ + Returns the unique elements of an input array ``x``, the first occurring indices for each unique element in ``x``, the indices from the set of unique elements that reconstruct ``x``, and the corresponding counts for each unique element in ``x``. + + .. admonition:: Data-dependent output shape + :class: important + + The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See :ref:`data-dependent-output-shapes` section for more details. + + Parameters + ---------- + x: array + input array. If ``x`` has more than one dimension, the function must flatten ``x`` and return the unique elements of the flattened array. + + Returns + ------- + out: Tuple[array, array, array, array] + a namedtuple ``(values, indices, inverse_indices, counts)`` whose + + - first element must have the field name ``values`` and must be an array containing the unique elements of ``x``. The array must have the same data type as ``x``. + - second element must have the field name ``indices`` and must be an array containing the indices (first occurrences) of ``x`` that result in ``values``. The array must have the same shape as ``values`` and must have the default array index data type. + - third element must have the field name ``inverse_indices`` and must be an array containing the indices of ``values`` that reconstruct ``x``. The array must have the same shape as ``x`` and must have the default array index data type. + - fourth element must have the field name ``counts`` and must be an array containing the number of times each unique element occurs in ``x``. The returned array must have same shape as ``values`` and must have the default array index data type. + + Notes + ----- + - Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. + + - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. + + - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). + + - As signed zeros are not distinct, using ``inverse_indices`` to reconstruct the input array is not guaranteed to return an array having the exact same values. + - Each ``nan`` value should have a count of one, while the counts for signed zeros should be aggregated as a single count. + - The order of unique elements is not specified and may vary between implementations. + """ + +def unique_counts(x: array, /) -> Tuple[array, array]: + """ + Returns the unique elements of an input array ``x`` and the corresponding counts for each unique element in ``x``. + + .. admonition:: Data-dependent output shape + :class: important + + The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See :ref:`data-dependent-output-shapes` section for more details. + + Parameters + ---------- + x: array + input array. If ``x`` has more than one dimension, the function must flatten ``x`` and return the unique elements of the flattened array. + + Returns + ------- + out: Tuple[array, array] + a namedtuple `(values, counts)` whose + + - first element must have the field name ``values`` and must be an array containing the unique elements of ``x``. The array must have the same data type as ``x``. + - second element must have the field name `counts` and must be an array containing the number of times each unique element occurs in ``x``. The returned array must have same shape as ``values`` and must have the default array index data type. + + Notes + ----- + - Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. + + - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. + - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). + + - Each ``nan`` value should have a count of one, while the counts for signed zeros should be aggregated as a single count. + - The order of unique elements is not specified and may vary between implementations. + """ + +def unique_inverse(x: array, /) -> Tuple[array, array]: + """ + Returns the unique elements of an input array ``x`` and the indices from the set of unique elements that reconstruct ``x``. + + .. admonition:: Data-dependent output shape + :class: important + + The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See :ref:`data-dependent-output-shapes` section for more details. + + Parameters + ---------- + x: array + input array. If ``x`` has more than one dimension, the function must flatten ``x`` and return the unique elements of the flattened array. + + Returns + ------- + out: Tuple[array, array] + a namedtuple ``(values, inverse_indices)`` whose + + - first element must have the field name ``values`` and must be an array containing the unique elements of ``x``. The array must have the same data type as ``x``. + - second element must have the field name ``inverse_indices`` and must be an array containing the indices of ``values`` that reconstruct ``x``. The array must have the same shape as ``x`` and have the default array index data type. + + Notes + ----- + - Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. + + - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. + - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). + + - As signed zeros are not distinct, using ``inverse_indices`` to reconstruct the input array is not guaranteed to return an array having the exact same values. + - The order of unique elements is not specified and may vary between implementations. + """ + +def unique_values(x: array, /) -> array: + """ + Returns the unique elements of an input array ``x``. + + .. admonition:: Data-dependent output shape + :class: important + + The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See :ref:`data-dependent-output-shapes` section for more details. + + Parameters + ---------- + x: array + input array. If ``x`` has more than one dimension, the function must flatten ``x`` and return the unique elements of the flattened array. + + Returns + ------- + out: array + an array containing the set of unique elements in ``x``. The returned array must have the same data type as ``x``. + + Notes + ----- + - Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. + + - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. + - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). + + - The order of unique elements is not specified and may vary between implementations. + """ + +__all__ = ['unique_all', 'unique_counts', 'unique_inverse', 'unique_values'] \ No newline at end of file From f43ffbbaaa2b3b17702efa9a2c9efb0d1913d79f Mon Sep 17 00:00:00 2001 From: Stephannie Jimenez Date: Tue, 25 Jan 2022 14:42:12 -0500 Subject: [PATCH 2/2] Update note directives --- .../signatures/set_functions.py | 78 ++++++++++--------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/spec/API_specification/signatures/set_functions.py b/spec/API_specification/signatures/set_functions.py index 687acc3ab..bd24e5323 100644 --- a/spec/API_specification/signatures/set_functions.py +++ b/spec/API_specification/signatures/set_functions.py @@ -9,6 +9,17 @@ def unique_all(x: array, /) -> Tuple[array, array, array, array]: The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See :ref:`data-dependent-output-shapes` section for more details. + .. note:: + Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. + + - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. + + - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). + + As signed zeros are not distinct, using ``inverse_indices`` to reconstruct the input array is not guaranteed to return an array having the exact same values. + + Each ``nan`` value should have a count of one, while the counts for signed zeros should be aggregated as a single count. + Parameters ---------- x: array @@ -24,17 +35,8 @@ def unique_all(x: array, /) -> Tuple[array, array, array, array]: - third element must have the field name ``inverse_indices`` and must be an array containing the indices of ``values`` that reconstruct ``x``. The array must have the same shape as ``x`` and must have the default array index data type. - fourth element must have the field name ``counts`` and must be an array containing the number of times each unique element occurs in ``x``. The returned array must have same shape as ``values`` and must have the default array index data type. - Notes - ----- - - Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. - - - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. - - - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). - - - As signed zeros are not distinct, using ``inverse_indices`` to reconstruct the input array is not guaranteed to return an array having the exact same values. - - Each ``nan`` value should have a count of one, while the counts for signed zeros should be aggregated as a single count. - - The order of unique elements is not specified and may vary between implementations. + .. note:: + The order of unique elements is not specified and may vary between implementations. """ def unique_counts(x: array, /) -> Tuple[array, array]: @@ -46,6 +48,14 @@ def unique_counts(x: array, /) -> Tuple[array, array]: The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See :ref:`data-dependent-output-shapes` section for more details. + .. note:: + Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. + + - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. + - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). + + Each ``nan`` value should have a count of one, while the counts for signed zeros should be aggregated as a single count. + Parameters ---------- x: array @@ -59,15 +69,8 @@ def unique_counts(x: array, /) -> Tuple[array, array]: - first element must have the field name ``values`` and must be an array containing the unique elements of ``x``. The array must have the same data type as ``x``. - second element must have the field name `counts` and must be an array containing the number of times each unique element occurs in ``x``. The returned array must have same shape as ``values`` and must have the default array index data type. - Notes - ----- - - Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. - - - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. - - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). - - - Each ``nan`` value should have a count of one, while the counts for signed zeros should be aggregated as a single count. - - The order of unique elements is not specified and may vary between implementations. + .. note:: + The order of unique elements is not specified and may vary between implementations. """ def unique_inverse(x: array, /) -> Tuple[array, array]: @@ -79,6 +82,14 @@ def unique_inverse(x: array, /) -> Tuple[array, array]: The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See :ref:`data-dependent-output-shapes` section for more details. + .. note:: + Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. + + - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. + - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). + + As signed zeros are not distinct, using ``inverse_indices`` to reconstruct the input array is not guaranteed to return an array having the exact same values. + Parameters ---------- x: array @@ -92,15 +103,8 @@ def unique_inverse(x: array, /) -> Tuple[array, array]: - first element must have the field name ``values`` and must be an array containing the unique elements of ``x``. The array must have the same data type as ``x``. - second element must have the field name ``inverse_indices`` and must be an array containing the indices of ``values`` that reconstruct ``x``. The array must have the same shape as ``x`` and have the default array index data type. - Notes - ----- - - Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. - - - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. - - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). - - - As signed zeros are not distinct, using ``inverse_indices`` to reconstruct the input array is not guaranteed to return an array having the exact same values. - - The order of unique elements is not specified and may vary between implementations. + .. note:: + The order of unique elements is not specified and may vary between implementations. """ def unique_values(x: array, /) -> array: @@ -112,6 +116,12 @@ def unique_values(x: array, /) -> array: The shapes of two of the output arrays for this function depend on the data values in the input array; hence, array libraries which build computation graphs (e.g., JAX, Dask, etc.) may find this function difficult to implement without knowing array values. Accordingly, such libraries may choose to omit this function. See :ref:`data-dependent-output-shapes` section for more details. + .. note:: + Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. + + - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. + - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). + Parameters ---------- x: array @@ -122,14 +132,8 @@ def unique_values(x: array, /) -> array: out: array an array containing the set of unique elements in ``x``. The returned array must have the same data type as ``x``. - Notes - ----- - - Uniqueness should be determined based on value equality (i.e., ``x_i == x_j``). For input arrays having floating-point data types, value-based equality implies the following behavior. - - - As ``nan`` values compare as ``False``, ``nan`` values should be considered distinct. - - As ``-0`` and ``+0`` compare as ``True``, signed zeros should not be considered distinct, and the corresponding unique element will be implementation-dependent (e.g., an implementation could choose to return ``-0`` if ``-0`` occurs before ``+0``). - - - The order of unique elements is not specified and may vary between implementations. + .. note:: + The order of unique elements is not specified and may vary between implementations. """ __all__ = ['unique_all', 'unique_counts', 'unique_inverse', 'unique_values'] \ No newline at end of file