diff --git a/.gitignore b/.gitignore index 4cf25ad..9deecb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -# Excel -*.xlsx +# Redis? +dump.rdb \ No newline at end of file diff --git a/README.md b/README.md index 1646d1d..592438e 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,5 @@ Previously there were records dating back to 1992 that were removed by the websi I am welcoming anyone who wants to to port it to their own state to do so. I currently have a website hosting my numbers to be refreshed daily. Collaboration and suggestion at a more accurate algorithm is also welcome. Good luck! + +Old numbers have been re-added to analysis. \ No newline at end of file diff --git a/c25_ans.csv b/c25_ans.csv index af12903..f23391e 100644 --- a/c25_ans.csv +++ b/c25_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,Chance -14-18-2-22-5-9,31/16100 +14-16-18-2-22-9,171/88550 diff --git a/cash25.py b/cash25.py index fa43f02..fcbc2b8 100755 --- a/cash25.py +++ b/cash25.py @@ -6,6 +6,9 @@ from collections import Counter import csv def get_data(): + df_old = pd.read_excel('./excel_lotto_records/cash25.xlsx') + salvaged = df_old[['Date', 'Numbers']] + url = 'https://wvlottery.com/draw-games/cash-25/?game-analyze=cash-25&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -17,7 +20,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) diff --git a/d3_ans.csv b/d3_ans.csv index 149ec44..a65af5f 100644 --- a/d3_ans.csv +++ b/d3_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,Chance -0-3-8,3/100 +2-3-6,10123/15000 diff --git a/d4_ans.csv b/d4_ans.csv index 1ee53bf..ea3af1b 100644 --- a/d4_ans.csv +++ b/d4_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,Chance -3-5-6-8,67/1250 +3-5-6-8,27/500 diff --git a/daily3.py b/daily3.py index c1afec2..15f77e3 100755 --- a/daily3.py +++ b/daily3.py @@ -4,9 +4,10 @@ import pandas as pd import requests from collections import Counter import csv +from datetime import datetime def get_data(): - url = 'https://wvlottery.com/draw-games/daily-3/?game-analyze=daily-3&what-to-search=historysearch&date-range=1' + url = 'https://wvlottery.com/draw-games/daily-3/?game-analyze=daily-3&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", "X-Requested-With": "XMLHttpRequest" @@ -38,7 +39,7 @@ for n in range(0, 10): sorted_nums = sorted(likely_nums) total_freq = sum(frequency) -Chance = frac(total_freq, 1000) # Chance = number call freq / all possible numbers i.e. 1000 +Chance = frac(total_freq, 15000) # Chance = number call freq / all possible numbers i.e. 1000 Winning_Numbers = str("-".join(sorted_nums)) #print(f"Likely numbers are . . . {Winning_Numbers} \n" diff --git a/daily4.py b/daily4.py index 8e1c477..9cfa094 100755 --- a/daily4.py +++ b/daily4.py @@ -6,6 +6,9 @@ from collections import Counter import csv def get_data(): + df_old = pd.read_excel('./excel_lotto_records/daily4.xlsx') + salvaged = df_old[['Date', 'Numbers']] + url = 'https://wvlottery.com/draw-games/daily-4/?game-analyze=daily-4&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -16,7 +19,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) @@ -41,7 +44,7 @@ total_freq = sum(frequency) Chance = frac(total_freq, 10000) # Chance = number call freq / all possible numbers i.e. 10000 Winning_Numbers = str("-".join(sorted_nums)) -#print(f"Likely numbers are . . . {Winning_Numbers}, \n" +#print(f"Likely numbers are . . . {Winning_Numbers} \n" #f"With percent chance of winning being {Chance}") d = dict(((k, eval (k)) for k in ('Winning_Numbers','Chance'))) diff --git a/excel_lotto_records/cash25.xlsx b/excel_lotto_records/cash25.xlsx new file mode 100644 index 0000000..630547b Binary files /dev/null and b/excel_lotto_records/cash25.xlsx differ diff --git a/excel_lotto_records/daily3.xlsx b/excel_lotto_records/daily3.xlsx new file mode 100644 index 0000000..4eeba68 Binary files /dev/null and b/excel_lotto_records/daily3.xlsx differ diff --git a/excel_lotto_records/daily4.xlsx b/excel_lotto_records/daily4.xlsx new file mode 100644 index 0000000..dbf7351 Binary files /dev/null and b/excel_lotto_records/daily4.xlsx differ diff --git a/excel_lotto_records/lotto.xlsx b/excel_lotto_records/lotto.xlsx new file mode 100644 index 0000000..3b9a588 Binary files /dev/null and b/excel_lotto_records/lotto.xlsx differ diff --git a/excel_lotto_records/lotto_america.xlsx b/excel_lotto_records/lotto_america.xlsx new file mode 100644 index 0000000..4e5279a Binary files /dev/null and b/excel_lotto_records/lotto_america.xlsx differ diff --git a/excel_lotto_records/lotto_megamil.xlsx b/excel_lotto_records/lotto_megamil.xlsx new file mode 100644 index 0000000..31e5961 Binary files /dev/null and b/excel_lotto_records/lotto_megamil.xlsx differ diff --git a/la_ans.csv b/la_ans.csv index 79e7cba..9ee5753 100644 --- a/la_ans.csv +++ b/la_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,SB,Chance -1-10-27-32-8,[9],1/270725 +1-10-32-46-48,[9],47/8663200 diff --git a/lotto_america.py b/lotto_america.py index 58d509a..5de5c95 100755 --- a/lotto_america.py +++ b/lotto_america.py @@ -7,10 +7,13 @@ from collections import Counter import csv def get_data(): + df_old = pd.read_excel('./excel_lotto_records/lotto_america.xlsx') + salvaged = df_old[['Date', 'Numbers', 'SB']] + url = 'https://wvlottery.com/draw-games/lotto-america/?game-analyze=lotto-america&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", - "X-Requested-With": "XMLHttpRequest" + "X-Requeste, 'PPX', 'Winners WV Only', 'Payout WV Onlyd-With": "XMLHttpRequest" } # Get web data @@ -18,7 +21,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers', 'SB', 'All Star']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) diff --git a/lottopy_pb.py b/lottopy_pb.py index bc41372..a1c8e71 100755 --- a/lottopy_pb.py +++ b/lottopy_pb.py @@ -6,6 +6,9 @@ from collections import Counter import csv def get_data(): + df_old = pd.read_excel('./excel_lotto_records/lotto.xlsx') + salvaged = df_old[['Date', 'Numbers', 'PB', 'PPX', 'Winners WV Only', 'Payout WV Only']] + url = 'https://wvlottery.com/draw-games/powerball/?game-analyze=powerball&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -16,7 +19,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers', 'PB', 'PPX', 'Winners WV Only', 'Payout WV Only']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) @@ -55,4 +58,4 @@ h = 'Winning_Numbers', 'PB', 'Chance' f = open('pb_ans.csv', 'w', encoding='utf_8') writer = csv.DictWriter(f, fieldnames=h) writer.writeheader() -writer.writerow(d) +writer.writerow(d) \ No newline at end of file diff --git a/megamil.py b/megamil.py index 6788a5c..ec50762 100755 --- a/megamil.py +++ b/megamil.py @@ -7,6 +7,9 @@ import csv def get_data(): + df_old = pd.read_excel('./excel_lotto_records/lotto_megamil.xlsx') + salvaged = df_old[['Date', 'Numbers', 'MB']] + url = 'https://wvlottery.com/draw-games/mega-millions/?game-analyze=mega-millions&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -18,7 +21,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers', 'MB', 'MP']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) diff --git a/mm_ans.csv b/mm_ans.csv index 8f740b6..27cf792 100644 --- a/mm_ans.csv +++ b/mm_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,MB,Chance -17-3-40-52-7,[24],38/151287675 +17-21-3-40-7,[9],131/302575350 diff --git a/pb_ans.csv b/pb_ans.csv index 7e37982..56d42ad 100644 --- a/pb_ans.csv +++ b/pb_ans.csv @@ -1,2 +1,2 @@ Winning_Numbers,PB,Chance -21-39-59-61-63,[17],50/146100669 +21-39-48-61-63,[18],193/292201338