Skip to content

Commit

Permalink
only return original y if all x values identical
Browse files Browse the repository at this point in the history
  • Loading branch information
danibene authored Aug 25, 2022
1 parent 2b647b9 commit cd02053
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion neurokit2/signal/signal_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def signal_interpolate(
if len(x_values) == x_new:
return y_values
else:
if len(x_values) == len(x_new):
# if x_values is identical to x_new, no need for interpolation
if np.all(x_values == x_new):
return y_values
if method == "monotone_cubic":
interpolation_function = scipy.interpolate.PchipInterpolator(
Expand Down

0 comments on commit cd02053

Please sign in to comment.