Skip to content

Commit

Permalink
fix numpy deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelvallat committed Dec 22, 2024
1 parent 2b54270 commit 319a0fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/yasa/others.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def get_centered_indices(data, idx, npts_before, npts_after):

def rng(x):
"""Create a range before and after a given value."""
return np.arange(x - npts_before, x + npts_after + 1, dtype="int")
return np.arange(x[0] - npts_before, x[0] + npts_after + 1, dtype="int")

idx_ep = np.apply_along_axis(rng, 1, idx[..., np.newaxis])
# We drop the events for which the indices exceed data
Expand Down

0 comments on commit 319a0fe

Please sign in to comment.