From d89e4fd0c7455c64099319a0dbfc3f36ad1f5baf Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Tue, 5 Nov 2013 11:11:36 +0000 Subject: [PATCH] Few more whitespace tweaks --- norms.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/norms.py b/norms.py index 08cff74..f9fc1d7 100644 --- a/norms.py +++ b/norms.py @@ -13,7 +13,8 @@ def normalise(frequencies): [(1, 0.4082482904638631), (2, 0.8164965809277261), (3, 0.4082482904638631)] """ length = sum([f ** 2 for f in frequencies.values()]) ** 0.5 - return collections.defaultdict(int, ((k, v / length) for (k, v) in frequencies.items())) + return collections.defaultdict(int, ((k, v / length) + for (k, v) in frequencies.items())) def scale(frequencies): """Scale a set of frequencies so the largest is 1 @@ -28,7 +29,8 @@ def scale(frequencies): [(1, 0.5), (2, 1.0), (3, 0.5)] """ largest = max(frequencies.values()) - return collections.defaultdict(int, ((k, v / largest) for (k, v) in frequencies.items())) + return collections.defaultdict(int, ((k, v / largest) + for (k, v) in frequencies.items())) def l2(frequencies1, frequencies2): -- 2.34.1