From 04c3fc3cf720d246af139862027d4a2dbd532aeb Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Tue, 13 Oct 2020 07:32:04 +0200 Subject: [PATCH] fix: [readable] fix bug where the first value was missed --- bin/napkin.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/napkin.py b/bin/napkin.py index 9456b2e..8ff45f4 100644 --- a/bin/napkin.py +++ b/bin/napkin.py @@ -157,11 +157,9 @@ for anal in analysis: if args.o == "csv": print("{},{},{}".format(anal,a[0],a[1])) elif args.o == "readable": - if previous_value is None: - previous_value = a[1] - elif previous_value == a[1]: + if previous_value == a[1]: readable_table.append(["{}".format(a[0])]) - elif a[1] < previous_value: + elif previous_value is None or a[1] < previous_value: previous_value = a[1] readable_table.append(["{} occurences".format(a[1])]) readable_table.append(["{}".format(a[0])])