From a97ab6d35ce655c124b8622b5d4cf123039795a6 Mon Sep 17 00:00:00 2001 From: Fabio Costa Date: Thu, 26 Jun 2014 09:13:30 +0100 Subject: [PATCH] Update fingerprint.py --- dejavu/fingerprint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dejavu/fingerprint.py b/dejavu/fingerprint.py index 69a85c3..bc87c81 100755 --- a/dejavu/fingerprint.py +++ b/dejavu/fingerprint.py @@ -5,6 +5,7 @@ from scipy.ndimage.filters import maximum_filter from scipy.ndimage.morphology import (generate_binary_structure, iterate_structure, binary_erosion) import hashlib +from operator import itemgetter IDX_FREQ_I = 0 @@ -96,8 +97,7 @@ def generate_hashes(peaks, fan_value=DEFAULT_FAN_VALUE): [(e05b341a9b77a51fd26, 32), ... ] """ fingerprinted = set() # to avoid rehashing same pairs - - from operator import itemgetter + peaks.sort(key=itemgetter(1)) for i in range(len(peaks)):