Skip to content

Commit f9d7c62

Browse files
committed
interp: act on array copy
1 parent 7c75d64 commit f9d7c62

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fooof/utils/data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ def interpolate_spectrum(freqs, powers, interp_range, buffer=3):
101101
>>> freqs, powers = interpolate_spectrum(freqs, powers, [58, 62])
102102
"""
103103

104+
# Take a copy of the array, to not change original array
105+
powers = np.copy(powers)
106+
104107
# Get the set of frequency values that need to be interpolated
105108
interp_mask = np.logical_and(freqs >= interp_range[0], freqs <= interp_range[1])
106109
interp_freqs = freqs[interp_mask]

0 commit comments

Comments
 (0)