diff --git a/lottopy_site/lottopy/lottopy_web_edition/c25_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/c25_ans.csv index 68d8bff2..811b2d04 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/c25_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/c25_ans.csv @@ -1 +1,2 @@ -1,16,18,19,20,4,4.611518915866742 +Winning_Numbers,Chance +14-18-22-23-5-9,[0.19480519480519481] diff --git a/lottopy_site/lottopy/lottopy_web_edition/cash25.py b/lottopy_site/lottopy/lottopy_web_edition/cash25.py index c07c8d81..8d8b4cb5 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/cash25.py +++ b/lottopy_site/lottopy/lottopy_web_edition/cash25.py @@ -23,7 +23,7 @@ df2 = df[['Date', 'Numbers']] #print(df2) # To excel file -df2.to_excel('../lottopy/cash25.xlsx') +df2.to_excel('./cash25.xlsx') #Insert complete path to the excel file and index of the worksheet df = pd.read_excel("cash25.xlsx", sheet_name=0) @@ -53,7 +53,7 @@ ws.xlsx_to_dict(path='cash25.xlsx', select_sheet='Sheet1') # Formatting hyphenfree = [] for x in nums: - hyphenfree.append(x.replace('-',', ')) + hyphenfree.append(x.replace('–',', ')) splitlist = ", ".join(hyphenfree) sep = splitlist.split(", ") @@ -69,9 +69,13 @@ for n in range(0, 25): sorted_nums = sorted(likely_nums) total_freq = sum(frequency) -chance = [(total_freq / 177100) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = [(total_freq / 177100) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "\n", "With percent chance of winning being", chance[0]*100, "%") -f = open('c25_ans.csv', 'w') -writer = csv.writer(f) -writer.writerow(sorted_nums + chance) \ No newline at end of file +d = dict(((k, eval (k)) for k in ('Winning_Numbers','Chance'))) +h = 'Winning_Numbers', 'Chance' +f = open('c25_ans.csv', 'w', encoding='utf_8') +writer = csv.DictWriter(f, fieldnames=h) +writer.writeheader() +writer.writerow(d) \ No newline at end of file diff --git a/lottopy_site/lottopy/lottopy_web_edition/cash25.xlsx b/lottopy_site/lottopy/lottopy_web_edition/cash25.xlsx index 531e9cb5..5a475600 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/cash25.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/cash25.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/d3_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/d3_ans.csv index eee6b547..ccecb55c 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/d3_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/d3_ans.csv @@ -1 +1,2 @@ -0,8,9,0.29 +Winning_Numbers,Chance +0-4-6,[0.33] diff --git a/lottopy_site/lottopy/lottopy_web_edition/d4_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/d4_ans.csv index bac9ebec..3c640808 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/d4_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/d4_ans.csv @@ -1 +1,2 @@ -1,2,3,6,177.96 +Winning_Numbers,Chance +3-5-6-8,[5.35] diff --git a/lottopy_site/lottopy/lottopy_web_edition/daily3.py b/lottopy_site/lottopy/lottopy_web_edition/daily3.py index 6d34d039..85e47a2f 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/daily3.py +++ b/lottopy_site/lottopy/lottopy_web_edition/daily3.py @@ -23,7 +23,7 @@ df2 = df[['Date', 'Numbers']] #print(df2) # To excel file -df2.to_excel('../lottopy/daily3.xlsx') +df2.to_excel('./daily3.xlsx') #Insert complete path to the excel file and index of the worksheet df = pd.read_excel("daily3.xlsx", sheet_name=0) @@ -53,7 +53,7 @@ ws.xlsx_to_dict(path='daily3.xlsx', select_sheet='Sheet1') # Formatting hyphenfree = [] for x in nums: - hyphenfree.append(x.replace('-',', ')) + hyphenfree.append(x.replace('–',', ')) splitlist = ", ".join(hyphenfree) sep = splitlist.split(", ") @@ -69,9 +69,14 @@ for n in range(0, 10): sorted_nums = sorted(likely_nums) total_freq = sum(frequency) -chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "\n", "With percent chance of winning being", chance[0]*100, "%") -f = open('d3_ans.csv', 'w') -writer = csv.writer(f) -writer.writerow(sorted_nums + chance) \ No newline at end of file + +d = dict(((k, eval (k)) for k in ('Winning_Numbers','Chance'))) +h = 'Winning_Numbers', 'Chance' +f = open('d3_ans.csv', 'w', encoding='utf_8') +writer = csv.DictWriter(f, fieldnames=h) +writer.writeheader() +writer.writerow(d) diff --git a/lottopy_site/lottopy/lottopy_web_edition/daily3.xlsx b/lottopy_site/lottopy/lottopy_web_edition/daily3.xlsx index 624be57f..2d7be544 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/daily3.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/daily3.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/daily4.py b/lottopy_site/lottopy/lottopy_web_edition/daily4.py index 06937584..b23635da 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/daily4.py +++ b/lottopy_site/lottopy/lottopy_web_edition/daily4.py @@ -23,7 +23,7 @@ df2 = df[['Date', 'Numbers']] #print(df2) # To excel file -df2.to_excel('../lottopy/daily4.xlsx') +df2.to_excel('./daily4.xlsx') #Insert complete path to the excel file and index of the worksheet df = pd.read_excel("daily4.xlsx", sheet_name=0) @@ -53,7 +53,7 @@ ws.xlsx_to_dict(path='daily4.xlsx', select_sheet='Sheet1') # Formatting hyphenfree = [] for x in nums: - hyphenfree.append(x.replace('-',', ')) + hyphenfree.append(x.replace('–',', ')) splitlist = ", ".join(hyphenfree) sep = splitlist.split(", ") @@ -69,9 +69,13 @@ for n in range(0, 9): sorted_nums = sorted(likely_nums) total_freq = sum(frequency) -chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "\n", "With percent chance of winning being", chance[0]*100, "%") -f = open('d4_ans.csv', 'w') -writer = csv.writer(f) -writer.writerow(sorted_nums + chance) \ No newline at end of file +d = dict(((k, eval (k)) for k in ('Winning_Numbers','Chance'))) +h = 'Winning_Numbers', 'Chance' +f = open('d4_ans.csv', 'w', encoding='utf_8') +writer = csv.DictWriter(f, fieldnames=h) +writer.writeheader() +writer.writerow(d) \ No newline at end of file diff --git a/lottopy_site/lottopy/lottopy_web_edition/daily4.xlsx b/lottopy_site/lottopy/lottopy_web_edition/daily4.xlsx index 71450445..30b891be 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/daily4.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/daily4.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/la_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/la_ans.csv index bb32cbf3..ba93646c 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/la_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/la_ans.csv @@ -1 +1,2 @@ -1,10,25,34,35,9,0.001204327885000154 +Winning_Numbers,SB,Chance +1-10-32-36-8,[3],[0.00036937852063902485] diff --git a/lottopy_site/lottopy/lottopy_web_edition/lotto.xlsx b/lottopy_site/lottopy/lottopy_web_edition/lotto.xlsx index 98170c8b..997e970a 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/lotto.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/lotto.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/lotto_america.py b/lottopy_site/lottopy/lottopy_web_edition/lotto_america.py index 7d1e1d43..a9070df1 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/lotto_america.py +++ b/lottopy_site/lottopy/lottopy_web_edition/lotto_america.py @@ -1,4 +1,5 @@ # WVLottopy: Matteo DiBiagio +#from django_lottopy.lottopy_site.lottopy.lottopy_web_edition.megamil import Winning_Numbers from sheet2dict import Worksheet import pandas as pd import requests @@ -23,7 +24,7 @@ df2 = df[['Date', 'Numbers', 'SB', 'All Star']] #print(df2) # To excel file -df2.to_excel('../lottopy/lotto_america.xlsx') +df2.to_excel('./lotto_america.xlsx') #Insert complete path to the excel file and index of the worksheet df = pd.read_excel("lotto_america.xlsx", sheet_name=0) @@ -31,7 +32,7 @@ df = pd.read_excel("lotto_america.xlsx", sheet_name=0) # insert the name of the column as a string in brackets date = list(df['Date']) nums = list(df['Numbers'].astype('str')) -PB = list(df['SB'].astype('int')) +PBs = list(df['SB'].astype('int')) #appearances = list(df2['Winners WV Only'].astype('int')) # Index for each row @@ -53,7 +54,7 @@ ws.xlsx_to_dict(path='lotto_america.xlsx', select_sheet='Sheet1') # Formatting hyphenfree = [] for x in nums: - hyphenfree.append(x.replace('-',', ')) + hyphenfree.append(x.replace('–',', ')) splitlist = ", ".join(hyphenfree) sep = splitlist.split(", ") @@ -63,15 +64,20 @@ for n in range(0, 52): frequency = [v[-1] for v in most_common] for n in range(0, 10): - most_common_pb = Counter(PB).most_common(1) - likely_pb = [v[0] for v in most_common_pb] + most_common_pb = Counter(PBs).most_common(1) + SB = [v[0] for v in most_common_pb] frequency_pb = [v[-1] for v in most_common_pb] sorted_nums = sorted(likely_nums) total_freq = sum(frequency + frequency_pb) -chance = [(total_freq / 25989600) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = [(total_freq / 25989600) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "SB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%") -f = open('la_ans.csv', 'w') -writer = csv.writer(f) -writer.writerow(sorted_nums + likely_pb + chance) +d = dict(((k, eval (k)) for k in ('Winning_Numbers', 'SB', 'Chance'))) +h = 'Winning_Numbers', 'SB', 'Chance' +f = open('la_ans.csv', 'w', encoding='utf_8') +writer = csv.DictWriter(f, fieldnames=h) +writer.writeheader() +writer.writerow(d) + diff --git a/lottopy_site/lottopy/lottopy_web_edition/lotto_america.xlsx b/lottopy_site/lottopy/lottopy_web_edition/lotto_america.xlsx index bbd42f41..28fed763 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/lotto_america.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/lotto_america.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/lotto_megamil.xlsx b/lottopy_site/lottopy/lottopy_web_edition/lotto_megamil.xlsx index e8142d2e..39328de1 100644 Binary files a/lottopy_site/lottopy/lottopy_web_edition/lotto_megamil.xlsx and b/lottopy_site/lottopy/lottopy_web_edition/lotto_megamil.xlsx differ diff --git a/lottopy_site/lottopy/lottopy_web_edition/lottopy_pb.py b/lottopy_site/lottopy/lottopy_web_edition/lottopy_pb.py index 2cb79186..f1a013c7 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/lottopy_pb.py +++ b/lottopy_site/lottopy/lottopy_web_edition/lottopy_pb.py @@ -1,5 +1,4 @@ # WVLottopy: Matteo DiBiagio -from encodings import utf_8 from sheet2dict import Worksheet import pandas as pd import requests @@ -24,7 +23,7 @@ df2 = df[['Date', 'Numbers', 'PB', 'PPX', 'Winners WV Only', 'Payout WV Only']] #print(df2) # To excel file -df2.to_excel('../lottopy_web_edition/lotto.xlsx') +df2.to_excel('./lotto.xlsx') #Insert complete path to the excel file and index of the worksheet df = pd.read_excel("lotto.xlsx", sheet_name=0) @@ -32,7 +31,7 @@ df = pd.read_excel("lotto.xlsx", sheet_name=0) # insert the name of the column as a string in brackets date = list(df['Date']) nums = list(df['Numbers'].astype('str')) -PB = list(df['PB'].astype('int')) +PBs = list(df['PB'].astype('int')) appearances = list(df2['Winners WV Only'].astype('int')) # Index for each row @@ -54,7 +53,7 @@ ws.xlsx_to_dict(path='lotto.xlsx', select_sheet='Sheet1') # Formatting hyphenfree = [] for x in nums: - hyphenfree.append(x.replace('-',', ')) + hyphenfree.append(x.replace('–',', ')) splitlist = ", ".join(hyphenfree) sep = splitlist.split(", ") @@ -64,19 +63,20 @@ for n in range(0, 69): frequency = [v[-1] for v in most_common] for n in range(0, 26): - most_common_pb = Counter(PB).most_common(1) - likely_pb = str([v[0] for v in most_common_pb]) + most_common_pb = Counter(PBs).most_common(1) + PB = [v[0] for v in most_common_pb] frequency_pb = [v[-1] for v in most_common_pb] sorted_nums = sorted(likely_nums) -final_nums = str("-".join(sorted_nums)) total_freq = sum(frequency + frequency_pb) -chance = str([(total_freq / 292201338) * 100]) # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = [(total_freq / 292201338) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "PB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%") +d = dict(((k, eval (k)) for k in ('Winning_Numbers', 'PB', 'Chance'))) +h = 'Winning_Numbers', 'PB', 'Chance' f = open('pb_ans.csv', 'w', encoding='utf_8') -writer = csv.writer(f) -writer.writerow([final_nums]) -writer.writerow([likely_nums]) -writer.writerow([chance]) \ No newline at end of file +writer = csv.DictWriter(f, fieldnames=h) +writer.writeheader() +writer.writerow(d) diff --git a/lottopy_site/lottopy/lottopy_web_edition/megamil.py b/lottopy_site/lottopy/lottopy_web_edition/megamil.py index d5d22d3d..cd896921 100755 --- a/lottopy_site/lottopy/lottopy_web_edition/megamil.py +++ b/lottopy_site/lottopy/lottopy_web_edition/megamil.py @@ -23,7 +23,7 @@ df2 = df[['Date', 'Numbers', 'MB', 'MP']] #print(df2) # To excel file -df2.to_excel('../lottopy/lotto_megamil.xlsx') +df2.to_excel('./lotto_megamil.xlsx') #Insert complete path to the excel file and index of the worksheet df = pd.read_excel("lotto_megamil.xlsx", sheet_name=0) @@ -31,7 +31,7 @@ df = pd.read_excel("lotto_megamil.xlsx", sheet_name=0) # insert the name of the column as a string in brackets date = list(df['Date']) nums = list(df['Numbers'].astype('str')) -PB = list(df['MB'].astype('int')) +PBs = list(df['MB'].astype('int')) #appearances = list(df2['Winners WV Only'].astype('int')) # Index for each row @@ -53,7 +53,7 @@ ws.xlsx_to_dict(path='lotto_megamil.xlsx', select_sheet='Sheet1') # Formatting hyphenfree = [] for x in nums: - hyphenfree.append(x.replace('-',', ')) + hyphenfree.append(x.replace('–',', ')) splitlist = ", ".join(hyphenfree) sep = splitlist.split(", ") @@ -63,15 +63,19 @@ for n in range(0, 70): frequency = [v[-1] for v in most_common] for n in range(0, 25): - most_common_pb = Counter(PB).most_common(1) - likely_pb = [v[0] for v in most_common_pb] + most_common_pb = Counter(PBs).most_common(1) + MB = [v[0] for v in most_common_pb] frequency_pb = [v[-1] for v in most_common_pb] sorted_nums = sorted(likely_nums) total_freq = sum(frequency + frequency_pb) -chance = [(total_freq / 302575350) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Chance = [(total_freq / 302575350) * 100] # Chance = number call freq / all possible numbers i.e. 11238513 +Winning_Numbers = str("-".join(sorted_nums)) #print("Likely numbers are . . . ", sorted_nums, "MB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%") -f = open('mm_ans.csv', 'w') -writer = csv.writer(f) -writer.writerow(sorted_nums + likely_pb + chance) \ No newline at end of file +d = dict(((k, eval (k)) for k in ('Winning_Numbers', 'MB', 'Chance'))) +h = 'Winning_Numbers', 'MB', 'Chance' +f = open('mm_ans.csv', 'w', encoding='utf_8') +writer = csv.DictWriter(f, fieldnames=h) +writer.writeheader() +writer.writerow(d) diff --git a/lottopy_site/lottopy/lottopy_web_edition/mm_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/mm_ans.csv index f2c6eb90..32d70943 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/mm_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/mm_ans.csv @@ -1 +1,2 @@ -10,11,17,20,31,9,0.0002135005379651713 +Winning_Numbers,MB,Chance +17-21-26-52-7,[24],[2.478721416004311e-05] diff --git a/lottopy_site/lottopy/lottopy_web_edition/pb_ans.csv b/lottopy_site/lottopy/lottopy_web_edition/pb_ans.csv index d911b7ef..5c3d08c8 100644 --- a/lottopy_site/lottopy/lottopy_web_edition/pb_ans.csv +++ b/lottopy_site/lottopy/lottopy_web_edition/pb_ans.csv @@ -1,3 +1,2 @@ -22-23-28-32-41 -"['23', '32', '28', '41', '22']" -[0.0005400385948951404] +Winning_Numbers,PB,Chance +21-39-59-61-63,[17],[3.216959944242281e-05]