You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to pandas' Series.Diff, the pairwise_diff function computes the first order difference of an array, i.e. output[i] = input[i] - input[i-period] where period is configurable.
Component(s)
C++
The text was updated successfully, but these errors were encountered:
### Rationale for this change
Add a `pairwise_diff` function similar to pandas' [Series.Diff](https://pandas.pydata.org/docs/reference/api/pandas.Series.diff.html), the function computes the first order difference of an array.
### What changes are included in this PR?
I followed [these instructions](#12460 (comment)). The function is implemented for numerical, temporal and decimal types. Chuck arrays are not yet supported.
### Are these changes tested?
Yes. They are tested in vector_pairwise_test.cc and in python/pyarrow/tests/compute.py.
### Are there any user-facing changes?
Yes, and docs are also updated in this PR.
* Closes: #35786
Lead-authored-by: Jin Shang <[email protected]>
Co-authored-by: Benjamin Kietzman <[email protected]>
Signed-off-by: Benjamin Kietzman <[email protected]>
Describe the enhancement requested
Similar to pandas' Series.Diff, the
pairwise_diff
function computes the first order difference of an array, i.e. output[i] = input[i] - input[i-period] where period is configurable.Component(s)
C++
The text was updated successfully, but these errors were encountered: