diff --git a/dejavu/fingerprint.py b/dejavu/fingerprint.py index 2617aaf..1455900 100755 --- a/dejavu/fingerprint.py +++ b/dejavu/fingerprint.py @@ -110,12 +110,14 @@ def get_2D_peaks(arr2D, plot=False, amp_min=DEFAULT_AMP_MIN): # filter peaks amps = amps.flatten() peaks = zip(i, j, amps) - peaks_filtered = [x for x in peaks if x[2] > amp_min] # freq, time, amp - + peaks_filtered = filter(lambda x: x[2]>amp_min, peaks) # freq, time, amp # get indices for frequency and time - frequency_idx = [x[1] for x in peaks_filtered] - time_idx = [x[0] for x in peaks_filtered] - + frequency_idx = [] + time_idx = [] + for x in peaks_filtered: + frequency_idx.append(x[1]) + time_idx.append(x[0]) + if plot: # scatter of the peaks fig, ax = plt.subplots()