Skip NaN values when integrating using numpy trapz

123 views Asked by At

I am using the numpy function trapz to perform integration. Some of my arrays have NaN values and I'd like the trapezoidal algorithm to simply "skip" over those values when computing the trapezoids rather than returning NaN for that slice. Is there a simple way to accomplish this? I've looked at scipy's trapz function and it doesn't seem to be able to do this either.

0

There are 0 answers