Skip to content

Commit

Permalink
interpolate: convert to numpy earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Oct 10, 2023
1 parent e24594b commit aff4fbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion orangecontrib/spectroscopy/preprocess/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ def interp1d_with_unknowns_numpy(x, ys, points, kind="linear", sides=np.nan):
sorti = np.argsort(x)
x = x[sorti]
for i, y in enumerate(ys):
y = y[sorti]
# the next line ensures numpy arrays
# for Dask, it would be much more efficient to work with larger sections
y = np.array(y[sorti])
nan = np.isnan(y)
xt = x[~nan]
yt = y[~nan]
Expand Down

0 comments on commit aff4fbf

Please sign in to comment.