Skip to content

Commit

Permalink
Revert unnecessary edits of compute.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
danepitkin committed Aug 9, 2023
1 parent 1c38537 commit 88db07c
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions docs/source/cpp/compute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Computation inputs are represented as a general :class:`Datum` class,
which is a tagged union of several shapes of data such as :class:`Scalar`,
:class:`Array` and :class:`ChunkedArray`. Many compute functions support
both array (chunked or not) and scalar inputs, however some will mandate
particular input types. For example, while ``array_sort_indices`` requires its
first and only input to be an array, the generalized ``sort_indices``
particular input types. For example, while ``array_sort_indices`` requires its
first and only input to be an array, the generalized ``sort_indices``
function accepts an array, chunked array, record batch or table.

.. _invoking-compute-functions:
Expand Down Expand Up @@ -572,28 +572,28 @@ representation based on the rounding criterion.
| trunc | Unary | Numeric | Float32/Float64/Decimal | | |
+-------------------+------------+-------------+-------------------------+----------------------------------+--------+

* \(1) By default rounding functions change a value to the nearest
integer using HALF_TO_EVEN to resolve ties. Options are available to control
the rounding criterion. All ``round`` functions have the
* \(1) By default rounding functions change a value to the nearest
integer using HALF_TO_EVEN to resolve ties. Options are available to control
the rounding criterion. All ``round`` functions have the
``round_mode`` option to set the rounding mode.
* \(2) Round to a number of digits where the ``ndigits`` option of
:struct:`RoundOptions` specifies the rounding precision in terms of number
of digits. A negative value corresponds to digits in the non-fractional
part. For example, -2 corresponds to rounding to the nearest multiple of
100 (zeroing the ones and tens digits). Default value of ``ndigits`` is 0
which rounds to the nearest integer. For integer inputs a non-negative
which rounds to the nearest integer. For integer inputs a non-negative
``ndigits`` value is ignored and the input is returned unchanged. For integer
inputs, if ``-ndigits`` is larger than the maximum number of digits the
inputs, if ``-ndigits`` is larger than the maximum number of digits the
input type can hold, an error is returned.
* \(3) Round to a multiple where the ``multiple`` option of
:struct:`RoundToMultipleOptions` specifies the rounding scale. The rounding
multiple has to be a positive value and can be casted to input type.
For example, 100 corresponds to rounding to the nearest multiple of 100
(zeroing the ones and tens digits). Default value of ``multiple`` is 1 which
multiple has to be a positive value and can be casted to input type.
For example, 100 corresponds to rounding to the nearest multiple of 100
(zeroing the ones and tens digits). Default value of ``multiple`` is 1 which
rounds to the nearest integer.
* \(4) Round the first input to multiple of the second input. The rounding
multiple has to be a positive value and can be casted to the first input type.
For example, 100 corresponds to rounding to the nearest multiple of 100
multiple has to be a positive value and can be casted to the first input type.
For example, 100 corresponds to rounding to the nearest multiple of 100
(zeroing the ones and tens digits).

For ``round`` functions, the following rounding modes are available.
Expand Down Expand Up @@ -634,8 +634,8 @@ The example values are given for default values of ``ndigits`` and ``multiple``.
| | | -3.5 -> -3, -4.5 -> -5 |
+-----------------------+--------------------------------------------------------------+---------------------------+

The following table gives examples of how ``ndigits`` (for the ``round``
and ``round_binary`` functions) and ``multiple`` (for ``round_to_multiple``)
The following table gives examples of how ``ndigits`` (for the ``round``
and ``round_binary`` functions) and ``multiple`` (for ``round_to_multiple``)
influence the operation performed, respectively.

+--------------------+-------------------+---------------------------+
Expand Down Expand Up @@ -1621,12 +1621,12 @@ Array-wise ("vector") functions
Cumulative Functions
~~~~~~~~~~~~~~~~~~~~

Cumulative functions are vector functions that perform a running accumulation on
their input using a given binary associative operation with an identidy element
(a monoid) and output an array containing the corresponding intermediate running
values. The input is expected to be of numeric type. By default these functions
do not detect overflow. They are alsoavailable in an overflow-checking variant,
suffixed ``_checked``, which returns an ``Invalid`` :class:`Status` when
Cumulative functions are vector functions that perform a running accumulation on
their input using a given binary associative operation with an identidy element
(a monoid) and output an array containing the corresponding intermediate running
values. The input is expected to be of numeric type. By default these functions
do not detect overflow. They are alsoavailable in an overflow-checking variant,
suffixed ``_checked``, which returns an ``Invalid`` :class:`Status` when
overflow is detected.

+-------------------------+-------+-------------+-------------+--------------------------------+-----------+
Expand All @@ -1649,8 +1649,8 @@ overflow is detected.

* \(1) CumulativeOptions has two optional parameters. The first parameter
:member:`CumulativeOptions::start` is a starting value for the running
accumulation. It has a default value of 0 for `sum`, 1 for `prod`, min of
input type for `max`, and max of input type for `min`. Specified values of
accumulation. It has a default value of 0 for `sum`, 1 for `prod`, min of
input type for `max`, and max of input type for `min`. Specified values of
``start`` must be castable to the input type. The second parameter
:member:`CumulativeOptions::skip_nulls` is a boolean. When set to
false (the default), the first encountered null is propagated. When set to
Expand Down Expand Up @@ -1862,9 +1862,9 @@ replaced, based on the remaining inputs.

Pairwise functions
~~~~~~~~~~~~~~~~~~~~
Pairwise functions are unary vector functions that perform a binary operation on
Pairwise functions are unary vector functions that perform a binary operation on
a pair of elements in the input array, typically on adjacent elements. The n-th
output is computed by applying the binary operation to the n-th and (n-p)-th inputs,
output is computed by applying the binary operation to the n-th and (n-p)-th inputs,
where p is the period. The default period is 1, in which case the binary
operation is applied to adjacent pairs of inputs. The period can also be
negative, in which case the n-th output is computed by applying the binary
Expand All @@ -1878,9 +1878,9 @@ operation to the n-th and (n+abs(p))-th inputs.
| pairwise_diff_checked | Unary | Numeric/Temporal | Numeric/Temporal | :struct:`PairwiseOptions` | \(1)(3) |
+------------------------+-------+----------------------+----------------------+--------------------------------+----------+

* \(1) Computes the first order difference of an array, It internally calls
the scalar function ``Subtract`` (or the checked variant) to compute
differences, so its behavior and supported types are the same as
``Subtract``. The period can be specified in :struct:`PairwiseOptions`.
* \(1) Computes the first order difference of an array, It internally calls
the scalar function ``Subtract`` (or the checked variant) to compute
differences, so its behavior and supported types are the same as
``Subtract``. The period can be specified in :struct:`PairwiseOptions`.
* \(2) Wraps around the result when overflow is detected.
* \(3) Returns an ``Invalid`` :class:`Status` when overflow is detected.

0 comments on commit 88db07c

Please sign in to comment.