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
Feature Description
I propose adding a trapz or trapezoid function to our data science library for numerical integration using the trapezoidal rule. NumPy already provides this functionality with numpy.trapz, and it would be beneficial for users to have a native implementation within our library. This function is used for approximating the integral of discrete data points, which is a common task in data analysis, signal processing, and scientific computing. We came across the need for this function while testing Arkouda in a potential new use case.
Adding this to the array_api would be easiest since we can use the existing array_api functionality to build up the trapz implementation just like NumPy using xp.diff and vector operations.
Example Behavior
Expected behavior of the function:
Describe Workarounds
Users could make up their own trapz by using the basic building blocks like xp.diff and slicing and multiplication. Or they can call out to numpy.trapz
Although trapz has been deprecated since Numpy 2.0.0 and replaced with trapezoid, Arkouda still uses Numpu 1.26 so we should have both overloads of the function available.
The text was updated successfully, but these errors were encountered:
Feature Description
I propose adding a
trapz
ortrapezoid
function to our data science library for numerical integration using the trapezoidal rule. NumPy already provides this functionality withnumpy.trapz
, and it would be beneficial for users to have a native implementation within our library. This function is used for approximating the integral of discrete data points, which is a common task in data analysis, signal processing, and scientific computing. We came across the need for this function while testing Arkouda in a potential new use case.Adding this to the array_api would be easiest since we can use the existing array_api functionality to build up the
trapz
implementation just like NumPy usingxp.diff
and vector operations.Example Behavior
Expected behavior of the function:
Describe Workarounds
Users could make up their own
trapz
by using the basic building blocks likexp.diff
and slicing and multiplication. Or they can call out tonumpy.trapz
Additional context
NumPy’s implementation of
trapz
ortrapezoid
is widely used and well-documented:https://numpy.org/doc/stable/reference/generated/numpy.trapezoid.html
https://numpy.org/doc/1.26/reference/generated/numpy.trapz.html#numpy.trapz
Although
trapz
has been deprecated since Numpy2.0.0
and replaced withtrapezoid
, Arkouda still uses Numpu1.26
so we should have both overloads of the function available.The text was updated successfully, but these errors were encountered: