From d920dd97242b0453130bd1680c899c6dca853395 Mon Sep 17 00:00:00 2001 From: lottopy Date: Mon, 2 Jan 2023 12:35:52 -0500 Subject: [PATCH] fixed sorting --- cash25.py | 2 +- daily3.py | 2 +- daily4.py | 2 +- lotto_america.py | 2 +- lottopy_pb.py | 2 +- megamil.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cash25.py b/cash25.py index dda91e1..d30f465 100755 --- a/cash25.py +++ b/cash25.py @@ -40,7 +40,7 @@ for n in range(0, 25): likely_nums = [v[0] for v in most_common] frequency = [v[-1] for v in most_common] -sorted_nums = sorted(likely_nums) +sorted_nums = sorted(likely_nums, key=lambda x: (len(x), x)) total_freq = sum(frequency) Chance = frac(total_freq, 177100) # Chance = number call freq / all possible numbers i.e. 177100 Forecast = str("-".join(sorted_nums)) diff --git a/daily3.py b/daily3.py index cd183c7..a16d6a1 100755 --- a/daily3.py +++ b/daily3.py @@ -35,7 +35,7 @@ for n in range(0, 10): likely_nums = [v[0] for v in most_common] frequency = [v[-1] for v in most_common] -sorted_nums = sorted(likely_nums) +sorted_nums = sorted(likely_nums, key=lambda x: (len(x), x)) total_freq = sum(frequency) Chance = frac(total_freq, 15000) # Chance = number call freq / all possible numbers i.e. 1000 Forecast = str("-".join(sorted_nums)) diff --git a/daily4.py b/daily4.py index df16061..36b4c11 100755 --- a/daily4.py +++ b/daily4.py @@ -39,7 +39,7 @@ for n in range(0, 9): likely_nums = [v[0] for v in most_common] frequency = [v[-1] for v in most_common] -sorted_nums = sorted(likely_nums) +sorted_nums = sorted(likely_nums, key=lambda x: (len(x), x)) total_freq = sum(frequency) Chance = frac(total_freq, 10000) # Chance = number call freq / all possible numbers i.e. 10000 Forecast = str("-".join(sorted_nums)) diff --git a/lotto_america.py b/lotto_america.py index aef9154..873466f 100755 --- a/lotto_america.py +++ b/lotto_america.py @@ -45,7 +45,7 @@ for n in range(0, 10): SB = [v[0] for v in most_common_sb] frequency_sb = [v[-1] for v in most_common_sb] -sorted_nums = sorted(likely_nums) +sorted_nums = sorted(likely_nums, key=lambda x: (len(x), x)) total_freq = sum(frequency + frequency_sb) Chance = frac(total_freq, 25989600) # Chance = number call freq / all possible numbers i.e. 25,989,600 Forecast = str("-".join(sorted_nums)) diff --git a/lottopy_pb.py b/lottopy_pb.py index fcff1cd..5fca631 100755 --- a/lottopy_pb.py +++ b/lottopy_pb.py @@ -46,7 +46,7 @@ for n in range(0, 26): PB = [v[0] for v in most_common_pb] frequency_pb = [v[-1] for v in most_common_pb] -sorted_nums = sorted(likely_nums) +sorted_nums = sorted(likely_nums, key=lambda x: (len(x), x)) total_freq = sum(frequency + frequency_pb) Chance = frac(total_freq, 292201338) # Chance = number call freq / all possible numbers i.e. 292201338 Forecast = str("-".join(sorted_nums)) diff --git a/megamil.py b/megamil.py index 54a4415..b0b3f29 100755 --- a/megamil.py +++ b/megamil.py @@ -46,7 +46,7 @@ for n in range(0, 25): MB = [v[0] for v in most_common_mb] frequency_mb = [v[-1] for v in most_common_mb] -sorted_nums = sorted(likely_nums) +sorted_nums = sorted(likely_nums, key=lambda x: (len(x), x)) total_freq = sum(frequency + frequency_mb) Chance = frac(total_freq, 302575350) # Chance = number call freq / all possible numbers i.e. 11238513 Forecast = str("-".join(sorted_nums))