comment cleanup and added back the 2021 draws missing from the excel

This commit is contained in:
admin committed 2026-10-22 21:03:17 -04:00
1 parent a8698c88d3
commit 5c20a6b01d
16 files changed
+57 -73

No files matched your search

+6 -8
View File
@@ -7,7 +7,7 @@ from collections import Counter
import csv
def get_data():
# Old records from the excel sheets, wvlottery.com took these down but they go back to the early 90s on some games
# previous records which have since been removed from wvlottery.com's database
df_old = pd.read_excel('./excel_lotto_records/daily3.xlsx')
salvaged = df_old[['Date', 'Numbers']]
@@ -15,7 +15,7 @@ def get_data():
header = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36",
}
# Get web data, the new site pulls past draws from json 500 at a time
# Get web data, 500 draws a page
web = {'Date': [], 'Numbers': []}
page = 0
while True:
@@ -30,7 +30,7 @@ def get_data():
dfs = [pd.DataFrame(web)]
pd.set_option('display.max_rows', None)
# Specifies no max rows, otherwise only shows 10 records
# Adds any draw not in the sheet yet, so the excel record keeps growing
# adds new draws to the excel so the records keep growing
df = records.merge_save('./excel_lotto_records/daily3.xlsx', dfs[0], fallback=salvaged)
df2 = df[['Date', 'Numbers']]
date = list(df2['Date'])
@@ -40,13 +40,13 @@ def get_data():
date, nums = get_data()
# Formatting
# Site numbers come split by – and the excel records by - so it splits on both
# site uses – and the excel uses -
hyphenfree = []
for x in nums:
hyphenfree.append(x.replace('–',', ').replace('-',', '))
splitlist = ", ".join(hyphenfree)
sep = splitlist.split(", ")
# Only keep actual digits, gets rid of any blanks from the excel records
# gets rid of blanks from the excel
sep = [x for x in sep if x.isdigit() and int(x) <= 9]
for n in range(0, 10):
@@ -55,9 +55,7 @@ for n in range(0, 10):
frequency = [v[-1] for v in most_common]
sorted_nums = sorted(likely_nums, key=lambda x: (len(x), x))
# Chance = playing the forecast as a box (any order), 3 different digits can come up 6 ways out of 1000 = 3/500
# playing it straight (exact order) is 1/1000
Chance = frac(6, 1000)
Chance = frac(6, 1000) # box play, 6 ways out of 1000 (straight is 1/1000)
Forecast = str(" - ".join(sorted_nums))
#print(f"Likely numbers are . . . {Forecast} \n"