lottopy web edition functioning
This commit is contained in:
1 parent
6761806eb5
commit
2125745e99
29 files changed
+741
-11
No files matched your search
Submodule lottopy_site/lottopy/lottopy deleted from f478a71775.
@@ -0,0 +1,7 @@
|
|||||||
|
WVLotto.py
|
||||||
|
|
||||||
|
This script generates the five most likely lottery numbers and one powerball, based off frequency pulled.
|
||||||
|
|
||||||
|
This script uses an excel sheet to store the history of all WV Lottery numbers since 1992. It does NOT however guarantee you will win.
|
||||||
|
|
||||||
|
Good luck!
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
1,16,18,19,20,4,4.611518915866742
|
||||||
|
+77
@@ -0,0 +1,77 @@
|
|||||||
|
# WVLottopy: Matteo DiBiagio
|
||||||
|
from sheet2dict import Worksheet
|
||||||
|
import pandas as pd
|
||||||
|
import requests
|
||||||
|
from collections import Counter
|
||||||
|
import csv
|
||||||
|
|
||||||
|
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",
|
||||||
|
"X-Requested-With": "XMLHttpRequest"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get web data
|
||||||
|
r = requests.get(url, headers=header)
|
||||||
|
dfs = pd.read_html(r.text)
|
||||||
|
pd.set_option('display.max_rows', None)
|
||||||
|
# Specifies no max rows, otherwise only shows 10 records
|
||||||
|
#print(len(dfs))
|
||||||
|
df = dfs[0]
|
||||||
|
df2 = df[['Date', 'Numbers']]
|
||||||
|
# Print Table
|
||||||
|
#print(df2)
|
||||||
|
|
||||||
|
# To excel file
|
||||||
|
df2.to_excel('../lottopy/cash25.xlsx')
|
||||||
|
|
||||||
|
#Insert complete path to the excel file and index of the worksheet
|
||||||
|
df = pd.read_excel("cash25.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'))
|
||||||
|
#appearances = list(df2['Winners WV Only'].astype('int'))
|
||||||
|
|
||||||
|
# Index for each row
|
||||||
|
index = [i for i in range(0,len(nums)*6)]
|
||||||
|
|
||||||
|
# Create an object
|
||||||
|
ws = Worksheet()
|
||||||
|
|
||||||
|
# Convert active sheet (without specifying sheet name)
|
||||||
|
ws.xlsx_to_dict(path='cash25.xlsx')
|
||||||
|
|
||||||
|
# Convert sheet of the 'lotto.xslx' spreadsheet file.
|
||||||
|
ws.xlsx_to_dict(path='cash25.xlsx', select_sheet='Sheet1')
|
||||||
|
|
||||||
|
# object.header returns first row with the data in a spreadsheet, object.sheet_items returns converted rows as dictionaries in the array
|
||||||
|
#print(ws.header)
|
||||||
|
#print(ws.sheet_items)
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
hyphenfree = []
|
||||||
|
for x in nums:
|
||||||
|
hyphenfree.append(x.replace('-',', '))
|
||||||
|
splitlist = ", ".join(hyphenfree)
|
||||||
|
sep = splitlist.split(", ")
|
||||||
|
|
||||||
|
for n in range(0, 25):
|
||||||
|
most_common= Counter(sep).most_common(6)
|
||||||
|
likely_nums = [v[0] for v in most_common]
|
||||||
|
frequency = [v[-1] for v in most_common]
|
||||||
|
|
||||||
|
#for n in range(0, 26):
|
||||||
|
# most_common_pb = Counter(PB).most_common(1)
|
||||||
|
# likely_pb = [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)
|
||||||
|
chance = [(total_freq / 177100) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
|
||||||
|
|
||||||
|
#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)
|
||||||
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
0,8,9,0.29
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
1,2,3,6,177.96
|
||||||
|
+77
@@ -0,0 +1,77 @@
|
|||||||
|
# WVLottopy: Matteo DiBiagio
|
||||||
|
from sheet2dict import Worksheet
|
||||||
|
import pandas as pd
|
||||||
|
import requests
|
||||||
|
from collections import Counter
|
||||||
|
import csv
|
||||||
|
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get web data
|
||||||
|
r = requests.get(url, headers=header)
|
||||||
|
dfs = pd.read_html(r.text)
|
||||||
|
pd.set_option('display.max_rows', None)
|
||||||
|
# Specifies no max rows, otherwise only shows 10 records
|
||||||
|
#print(len(dfs))
|
||||||
|
df = dfs[0]
|
||||||
|
df2 = df[['Date', 'Numbers']]
|
||||||
|
# Print Table
|
||||||
|
#print(df2)
|
||||||
|
|
||||||
|
# To excel file
|
||||||
|
df2.to_excel('../lottopy/daily3.xlsx')
|
||||||
|
|
||||||
|
#Insert complete path to the excel file and index of the worksheet
|
||||||
|
df = pd.read_excel("daily3.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'))
|
||||||
|
#appearances = list(df2['Winners WV Only'].astype('int'))
|
||||||
|
|
||||||
|
# Index for each row
|
||||||
|
#index = [i for i in range(0,len(nums)*6)]
|
||||||
|
|
||||||
|
# Create an object
|
||||||
|
ws = Worksheet()
|
||||||
|
|
||||||
|
# Convert active sheet (without specifying sheet name)
|
||||||
|
ws.xlsx_to_dict(path='daily3.xlsx')
|
||||||
|
|
||||||
|
# Convert sheet of the 'lotto.xslx' spreadsheet file.
|
||||||
|
ws.xlsx_to_dict(path='daily3.xlsx', select_sheet='Sheet1')
|
||||||
|
|
||||||
|
# object.header returns first row with the data in a spreadsheet, object.sheet_items returns converted rows as dictionaries in the array
|
||||||
|
#print(ws.header)
|
||||||
|
#print(ws.sheet_items)
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
hyphenfree = []
|
||||||
|
for x in nums:
|
||||||
|
hyphenfree.append(x.replace('-',', '))
|
||||||
|
splitlist = ", ".join(hyphenfree)
|
||||||
|
sep = splitlist.split(", ")
|
||||||
|
|
||||||
|
for n in range(0, 10):
|
||||||
|
most_common= Counter(sep).most_common(3)
|
||||||
|
likely_nums = [v[0] for v in most_common]
|
||||||
|
frequency = [v[-1] for v in most_common]
|
||||||
|
|
||||||
|
#for n in range(0, 26):
|
||||||
|
# most_common_pb = Counter(PB).most_common(1)
|
||||||
|
# likely_pb = [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)
|
||||||
|
chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
|
||||||
|
|
||||||
|
#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)
|
||||||
Binary file not shown.
+77
@@ -0,0 +1,77 @@
|
|||||||
|
# WVLottopy: Matteo DiBiagio
|
||||||
|
from sheet2dict import Worksheet
|
||||||
|
import pandas as pd
|
||||||
|
import requests
|
||||||
|
from collections import Counter
|
||||||
|
import csv
|
||||||
|
|
||||||
|
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",
|
||||||
|
"X-Requested-With": "XMLHttpRequest"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get web data
|
||||||
|
r = requests.get(url, headers=header)
|
||||||
|
dfs = pd.read_html(r.text)
|
||||||
|
pd.set_option('display.max_rows', None)
|
||||||
|
# Specifies no max rows, otherwise only shows 10 records
|
||||||
|
#print(len(dfs))
|
||||||
|
df = dfs[0]
|
||||||
|
df2 = df[['Date', 'Numbers']]
|
||||||
|
# Print Table
|
||||||
|
#print(df2)
|
||||||
|
|
||||||
|
# To excel file
|
||||||
|
df2.to_excel('../lottopy/daily4.xlsx')
|
||||||
|
|
||||||
|
#Insert complete path to the excel file and index of the worksheet
|
||||||
|
df = pd.read_excel("daily4.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'))
|
||||||
|
#appearances = list(df2['Winners WV Only'].astype('int'))
|
||||||
|
|
||||||
|
# Index for each row
|
||||||
|
#index = [i for i in range(0,len(nums)*6)]
|
||||||
|
|
||||||
|
# Create an object
|
||||||
|
ws = Worksheet()
|
||||||
|
|
||||||
|
# Convert active sheet (without specifying sheet name)
|
||||||
|
ws.xlsx_to_dict(path='daily4.xlsx')
|
||||||
|
|
||||||
|
# Convert sheet of the 'lotto.xslx' spreadsheet file.
|
||||||
|
ws.xlsx_to_dict(path='daily4.xlsx', select_sheet='Sheet1')
|
||||||
|
|
||||||
|
# object.header returns first row with the data in a spreadsheet, object.sheet_items returns converted rows as dictionaries in the array
|
||||||
|
#print(ws.header)
|
||||||
|
#print(ws.sheet_items)
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
hyphenfree = []
|
||||||
|
for x in nums:
|
||||||
|
hyphenfree.append(x.replace('-',', '))
|
||||||
|
splitlist = ", ".join(hyphenfree)
|
||||||
|
sep = splitlist.split(", ")
|
||||||
|
|
||||||
|
for n in range(0, 9):
|
||||||
|
most_common= Counter(sep).most_common(4)
|
||||||
|
likely_nums = [v[0] for v in most_common]
|
||||||
|
frequency = [v[-1] for v in most_common]
|
||||||
|
|
||||||
|
#for n in range(0, 26):
|
||||||
|
# most_common_pb = Counter(PB).most_common(1)
|
||||||
|
# likely_pb = [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)
|
||||||
|
chance = [(total_freq / 10000) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
|
||||||
|
|
||||||
|
#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)
|
||||||
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
1,10,25,34,35,9,0.001204327885000154
|
||||||
|
Binary file not shown.
@@ -0,0 +1,77 @@
|
|||||||
|
# WVLottopy: Matteo DiBiagio
|
||||||
|
from sheet2dict import Worksheet
|
||||||
|
import pandas as pd
|
||||||
|
import requests
|
||||||
|
from collections import Counter
|
||||||
|
import csv
|
||||||
|
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get web data
|
||||||
|
r = requests.get(url, headers=header)
|
||||||
|
dfs = pd.read_html(r.text)
|
||||||
|
pd.set_option('display.max_rows', None)
|
||||||
|
# Specifies no max rows, otherwise only shows 10 records
|
||||||
|
#print(len(dfs))
|
||||||
|
df = dfs[0]
|
||||||
|
df2 = df[['Date', 'Numbers', 'SB', 'All Star']]
|
||||||
|
# Print Table
|
||||||
|
#print(df2)
|
||||||
|
|
||||||
|
# To excel file
|
||||||
|
df2.to_excel('../lottopy/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)
|
||||||
|
|
||||||
|
# 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'))
|
||||||
|
#appearances = list(df2['Winners WV Only'].astype('int'))
|
||||||
|
|
||||||
|
# Index for each row
|
||||||
|
index = [i for i in range(0,len(nums)*6)]
|
||||||
|
|
||||||
|
# Create an object
|
||||||
|
ws = Worksheet()
|
||||||
|
|
||||||
|
# Convert active sheet (without specifying sheet name)
|
||||||
|
ws.xlsx_to_dict(path='lotto_america.xlsx')
|
||||||
|
|
||||||
|
# Convert sheet of the 'lotto.xslx' spreadsheet file.
|
||||||
|
ws.xlsx_to_dict(path='lotto_america.xlsx', select_sheet='Sheet1')
|
||||||
|
|
||||||
|
# object.header returns first row with the data in a spreadsheet, object.sheet_items returns converted rows as dictionaries in the array
|
||||||
|
#print(ws.header)
|
||||||
|
#print(ws.sheet_items)
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
hyphenfree = []
|
||||||
|
for x in nums:
|
||||||
|
hyphenfree.append(x.replace('-',', '))
|
||||||
|
splitlist = ", ".join(hyphenfree)
|
||||||
|
sep = splitlist.split(", ")
|
||||||
|
|
||||||
|
for n in range(0, 52):
|
||||||
|
most_common= Counter(sep).most_common(5)
|
||||||
|
likely_nums = [v[0] for v in most_common]
|
||||||
|
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]
|
||||||
|
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
|
||||||
|
|
||||||
|
#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)
|
||||||
Binary file not shown.
Binary file not shown.
+78
@@ -0,0 +1,78 @@
|
|||||||
|
# WVLottopy: Matteo DiBiagio
|
||||||
|
from sheet2dict import Worksheet
|
||||||
|
import pandas as pd
|
||||||
|
import requests
|
||||||
|
from collections import Counter
|
||||||
|
import csv
|
||||||
|
|
||||||
|
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",
|
||||||
|
"X-Requested-With": "XMLHttpRequest"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get web data
|
||||||
|
r = requests.get(url, headers=header)
|
||||||
|
dfs = pd.read_html(r.text)
|
||||||
|
pd.set_option('display.max_rows', None)
|
||||||
|
# Specifies no max rows, otherwise only shows 10 records
|
||||||
|
#print(len(dfs))
|
||||||
|
df = dfs[0]
|
||||||
|
df2 = df[['Date', 'Numbers', 'PB', 'PPX', 'Winners WV Only', 'Payout WV Only']]
|
||||||
|
# Print Table
|
||||||
|
#print(df2)
|
||||||
|
|
||||||
|
# To excel file
|
||||||
|
df2.to_excel('../lottopy/lotto.xlsx')
|
||||||
|
|
||||||
|
#Insert complete path to the excel file and index of the worksheet
|
||||||
|
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'))
|
||||||
|
appearances = list(df2['Winners WV Only'].astype('int'))
|
||||||
|
|
||||||
|
# Index for each row
|
||||||
|
index = [i for i in range(0,len(nums)*6)]
|
||||||
|
|
||||||
|
# Create an object
|
||||||
|
ws = Worksheet()
|
||||||
|
|
||||||
|
# Convert active sheet (without specifying sheet name)
|
||||||
|
ws.xlsx_to_dict(path='lotto.xlsx')
|
||||||
|
|
||||||
|
# Convert sheet of the 'lotto.xslx' spreadsheet file.
|
||||||
|
ws.xlsx_to_dict(path='lotto.xlsx', select_sheet='Sheet1')
|
||||||
|
|
||||||
|
# object.header returns first row with the data in a spreadsheet, object.sheet_items returns converted rows as dictionaries in the array
|
||||||
|
#print(ws.header)
|
||||||
|
#print(ws.sheet_items)
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
hyphenfree = []
|
||||||
|
for x in nums:
|
||||||
|
hyphenfree.append(x.replace('-',', '))
|
||||||
|
splitlist = ", ".join(hyphenfree)
|
||||||
|
sep = splitlist.split(", ")
|
||||||
|
|
||||||
|
for n in range(0, 69):
|
||||||
|
most_common= Counter(sep).most_common(5)
|
||||||
|
likely_nums = [v[0] for v in most_common]
|
||||||
|
frequency = [v[-1] for v in most_common]
|
||||||
|
|
||||||
|
for n in range(0, 26):
|
||||||
|
most_common_pb = Counter(PB).most_common(1)
|
||||||
|
likely_pb = [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 / 292201338) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
|
||||||
|
|
||||||
|
#print("Likely numbers are . . . ", sorted_nums, "PB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%")
|
||||||
|
|
||||||
|
f = open('pb_ans.csv', 'w')
|
||||||
|
writer = csv.writer(f)
|
||||||
|
writer.writerow(sorted_nums + likely_pb + chance)
|
||||||
+77
@@ -0,0 +1,77 @@
|
|||||||
|
# WVLottopy megamil: Matteo DiBiagio
|
||||||
|
from sheet2dict import Worksheet
|
||||||
|
import pandas as pd
|
||||||
|
import requests
|
||||||
|
from collections import Counter
|
||||||
|
import csv
|
||||||
|
|
||||||
|
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",
|
||||||
|
"X-Requested-With": "XMLHttpRequest"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get web data
|
||||||
|
r = requests.get(url, headers=header)
|
||||||
|
dfs = pd.read_html(r.text)
|
||||||
|
pd.set_option('display.max_rows', None)
|
||||||
|
# Specifies no max rows, otherwise only shows 10 records
|
||||||
|
#print(len(dfs))
|
||||||
|
df = dfs[0]
|
||||||
|
df2 = df[['Date', 'Numbers', 'MB', 'MP']]
|
||||||
|
# Print Table
|
||||||
|
#print(df2)
|
||||||
|
|
||||||
|
# To excel file
|
||||||
|
df2.to_excel('../lottopy/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)
|
||||||
|
|
||||||
|
# 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'))
|
||||||
|
#appearances = list(df2['Winners WV Only'].astype('int'))
|
||||||
|
|
||||||
|
# Index for each row
|
||||||
|
index = [i for i in range(0,len(nums)*6)]
|
||||||
|
|
||||||
|
# Create an object
|
||||||
|
ws = Worksheet()
|
||||||
|
|
||||||
|
# Convert active sheet (without specifying sheet name)
|
||||||
|
ws.xlsx_to_dict(path='lotto_megamil.xlsx')
|
||||||
|
|
||||||
|
# Convert sheet of the 'lotto.xslx' spreadsheet file.
|
||||||
|
ws.xlsx_to_dict(path='lotto_megamil.xlsx', select_sheet='Sheet1')
|
||||||
|
|
||||||
|
# object.header returns first row with the data in a spreadsheet, object.sheet_items returns converted rows as dictionaries in the array
|
||||||
|
#print(ws.header)
|
||||||
|
#print(ws.sheet_items)
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
hyphenfree = []
|
||||||
|
for x in nums:
|
||||||
|
hyphenfree.append(x.replace('-',', '))
|
||||||
|
splitlist = ", ".join(hyphenfree)
|
||||||
|
sep = splitlist.split(", ")
|
||||||
|
|
||||||
|
for n in range(0, 70):
|
||||||
|
most_common= Counter(sep).most_common(5)
|
||||||
|
likely_nums = [v[0] for v in most_common]
|
||||||
|
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]
|
||||||
|
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
|
||||||
|
|
||||||
|
#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)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
10,11,17,20,31,9,0.0002135005379651713
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
23,26,28,32,41,20,0.000539696365113838
|
||||||
|
@@ -0,0 +1,3 @@
|
|||||||
|
pandas==1.3.5
|
||||||
|
requests==2.26.0
|
||||||
|
sheet2dict==0.1.1
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
# WVLottopy: Matteo DiBiagio
|
||||||
|
from sheet2dict import Worksheet
|
||||||
|
import pandas as pd
|
||||||
|
import requests
|
||||||
|
from collections import Counter
|
||||||
|
|
||||||
|
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",
|
||||||
|
"X-Requested-With": "XMLHttpRequest"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get web data
|
||||||
|
r = requests.get(url, headers=header)
|
||||||
|
dfs = pd.read_html(r.text)
|
||||||
|
pd.set_option('display.max_rows', None)
|
||||||
|
# Specifies no max rows, otherwise only shows 10 records
|
||||||
|
#print(len(dfs))
|
||||||
|
df = dfs[0]
|
||||||
|
df2 = df[['Date', 'Numbers', 'PB', 'PPX', 'Winners WV Only', 'Payout WV Only']]
|
||||||
|
# Print Table
|
||||||
|
#print(df2)
|
||||||
|
|
||||||
|
# To excel file
|
||||||
|
df2.to_excel('../lottopy/lotto.xlsx')
|
||||||
|
|
||||||
|
#Insert complete path to the excel file and index of the worksheet
|
||||||
|
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'))
|
||||||
|
appearances = list(df2['Winners WV Only'].astype('int'))
|
||||||
|
|
||||||
|
# Index for each row
|
||||||
|
index = [i for i in range(0,len(nums)*6)]
|
||||||
|
|
||||||
|
# Create an object
|
||||||
|
ws = Worksheet()
|
||||||
|
|
||||||
|
# Convert active sheet (without specifying sheet name)
|
||||||
|
ws.xlsx_to_dict(path='lotto.xlsx')
|
||||||
|
|
||||||
|
# Convert sheet of the 'lotto.xslx' spreadsheet file.
|
||||||
|
ws.xlsx_to_dict(path='lotto.xlsx', select_sheet='Sheet1')
|
||||||
|
|
||||||
|
# object.header returns first row with the data in a spreadsheet, object.sheet_items returns converted rows as dictionaries in the array
|
||||||
|
#print(ws.header)
|
||||||
|
#print(ws.sheet_items)
|
||||||
|
|
||||||
|
# Formatting
|
||||||
|
hyphenfree = []
|
||||||
|
for x in nums:
|
||||||
|
hyphenfree.append(x.replace('-',', '))
|
||||||
|
splitlist = ", ".join(hyphenfree)
|
||||||
|
sep = splitlist.split(", ")
|
||||||
|
|
||||||
|
for n in range(0, 69):
|
||||||
|
most_common= Counter(sep).most_common(5)
|
||||||
|
likely_nums = [v[0] for v in most_common]
|
||||||
|
frequency = [v[-1] for v in most_common]
|
||||||
|
|
||||||
|
for n in range(0, 26):
|
||||||
|
most_common_pb = Counter(PB).most_common(1)
|
||||||
|
likely_pb = [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 / 292201338) * 100] # Chance = number call freq / all possible numbers i.e. 11238513
|
||||||
|
|
||||||
|
print("Likely numbers are . . . ", sorted_nums, "PB:", likely_pb, "\n", "With percent chance of winning being", chance[0]*100, "%")
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
echo "Powerball" && python lottopy_pb.py && echo "MegaMillions" && python megamil.py && echo "Lotto America" && python lotto_america.py && echo "Daily3" && python daily3.py && echo "Daily4" && python daily4.py && echo "Cash25" && python cash25.py
|
||||||
Binary file not shown.
@@ -26,7 +26,7 @@ SECRET_KEY = 'django-insecure-p4+um@+npnfqv=mul^--gz@$36@&7^)h@o*72&yqd@n00x$%e&
|
|||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = []
|
ALLOWED_HOSTS = ['fresh-fish-51.loca.lt']
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: var(--bs-body-font-family);
|
font-family: var(--bs-body-font-family);
|
||||||
font-size: var(--bs-body-font-size);
|
font-size: var(--bs-body-font-size);
|
||||||
@@ -88,6 +89,41 @@ body {
|
|||||||
-webkit-text-size-adjust: 100%;
|
-webkit-text-size-adjust: 100%;
|
||||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
.box
|
||||||
|
{
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%,-50%);
|
||||||
|
width: 600px;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5)
|
||||||
|
}
|
||||||
|
|
||||||
|
.box .svgBox
|
||||||
|
{
|
||||||
|
width: 150px;
|
||||||
|
flex: 0 0 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box .svgBox svg
|
||||||
|
{
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.box .content
|
||||||
|
{
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box .content body
|
||||||
|
{
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 10px 0 0;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
@@ -298,7 +334,7 @@ figure {
|
|||||||
|
|
||||||
img,
|
img,
|
||||||
svg {
|
svg {
|
||||||
vertical-align: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
@@ -638,6 +674,7 @@ progress {
|
|||||||
padding-left: var(--bs-gutter-x, 0.75rem);
|
padding-left: var(--bs-gutter-x, 0.75rem);
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 576px) {
|
@media (min-width: 576px) {
|
||||||
@@ -6426,6 +6463,11 @@ textarea.form-control-lg {
|
|||||||
mask-position: -200% 0%;
|
mask-position: -200% 0%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.clearfix {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.clearfix::after {
|
.clearfix::after {
|
||||||
display: block;
|
display: block;
|
||||||
clear: both;
|
clear: both;
|
||||||
@@ -6664,6 +6706,22 @@ textarea.form-control-lg {
|
|||||||
float: left !important;
|
float: left !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.float-left {
|
||||||
|
float: left;
|
||||||
|
width: 300px;
|
||||||
|
height: 200px;
|
||||||
|
background-color: red;
|
||||||
|
margin: 0 0 0.5rem 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-right {
|
||||||
|
float: right;
|
||||||
|
width: 300px;
|
||||||
|
height: 200px;
|
||||||
|
background-color: red;
|
||||||
|
margin: 0 0 0.5rem 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.float-end {
|
.float-end {
|
||||||
float: right !important;
|
float: right !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<a class="navbar-brand" href="{% url 'home' %}">
|
<a class="navbar-brand" href="{% url 'home' %}">
|
||||||
<img src="{% static 'bootstrap/pics/WVBall.png' %}" width="25" height="25" padding="1em" float="left">
|
<img src="{% static 'bootstrap/pics/WVBall.png' %}" id="navbarSupportedContent" width="25" float="left">
|
||||||
West Virginia Lottery Predictions</a>
|
West Virginia Lottery Predictions</a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
|
|||||||
@@ -2,11 +2,65 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Find your lucky numbers and hit big!</h1>
|
<h1>Find your lucky numbers and hit big!</h1>
|
||||||
<p class="lead">The purpose of this site is to analyze existing West Virginia winning lottery numbers, and return only the most likely combinations. This can be used to gain an edge on the lottery system, and help you win big!</p>
|
<p class="lead">The purpose of this site is to analyze existing West Virginia winning lottery numbers, and return only the most likely combinations. This can be used to gain an edge on the lottery system, and help you win big!</p>
|
||||||
<div class=table>
|
<section class="py-5 border-bottom" id="features">
|
||||||
<tr><svg width="250" height="250" class="col-2" align=left src="{% include 'pics/powerball-01.svg'%}"></svg></tr>
|
<hr class="container px-5 my-5">
|
||||||
<tr text-align=right>I hate web design!</tr>
|
<div class="row gx-5">
|
||||||
|
<div class="col-lg-4 mb-5 mb-lg-0">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-collection"></i></div>
|
||||||
|
<h2 class="col-auto" width=200>PowerBall</h2>
|
||||||
|
<p>{{ numbers }}</p>
|
||||||
|
<a>
|
||||||
|
Draws on ... Last draw: {{ pb_date }}
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 mb-5 mb-lg-0">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-building"></i></div>
|
||||||
|
<h2 class="col-auto" width=200>Mega Millions</h2>
|
||||||
|
<p>{{ numbers }}</p>
|
||||||
|
<a>
|
||||||
|
Draws on ... Last draw: {{ mm_date }}
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 mb-5 mb-lg-0">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-toggles2"></i></div>
|
||||||
|
<h2 class="col-auto" width=200>Lotto America</h2>
|
||||||
|
<p>{{ numbers }}</p>
|
||||||
|
<a>
|
||||||
|
Draws on ... Last draw: {{ la_date }}
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 mb-5 mb-lg-0">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-collection"></i></div>
|
||||||
|
<h2 class="col-auto" width=200>Daily4</h2>
|
||||||
|
<p>{{ numbers }}</p>
|
||||||
|
<a>
|
||||||
|
Draws on ... Last draw: {{ d4_date }}
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 mb-5 mb-lg-0">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-building"></i></div>
|
||||||
|
<h2 class="col-auto" width=200>Daily3</h2>
|
||||||
|
<p>{{ numbers }}</p>
|
||||||
|
<a>
|
||||||
|
Draws on ... Last draw: {{ d3_date }}
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-toggles2"></i></div>
|
||||||
|
<h2 class="col-auto" width=200>Cash25</h2>
|
||||||
|
<p>{{ numbers }}</p>
|
||||||
|
<a>
|
||||||
|
Draws on ... Last draw: {{ c25_date }}
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="card-footer" text-align=bottom>Dislaimer: WV Lottopy developers do not guarantee a win on the first or even the fortieth set of numbers. This is used to gain an <b><i>edge </i></b> over those who do not use this program.</h4>
|
</section>
|
||||||
{% endblock content %}
|
<h6 class="card-footer" text-align=bottom>Disclaimer: WV Lottopy developers do not guarantee a win on the first or even the fortieth set of numbers. This is used to gain an <b><i>edge </i></b> over those who do not use this program.</h6>
|
||||||
|
{% endblock content %}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
{% extends 'lottopy/base.html' %}
|
||||||
|
{% block content %}
|
||||||
|
<h1>Find your lucky numbers and hit big!</h1>
|
||||||
|
<p class="lead">The purpose of this site is to analyze existing West Virginia winning lottery numbers, and return only the most likely combinations. This can be used to gain an edge on the lottery system, and help you win big!</p>
|
||||||
|
<section class="py-5 border-bottom" id="features">
|
||||||
|
<hr class="container px-5 my-5">
|
||||||
|
<div class="row gx-5">
|
||||||
|
<div class="col-lg-4 mb-5 mb-lg-0">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-collection"></i></div>
|
||||||
|
<svg position=relative float=left width=150 class="col-auto" src="{% include 'pics/powerball-01.svg'%}"></svg>
|
||||||
|
<p>Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.</p>
|
||||||
|
<a class="text-decoration-none" href="#!">
|
||||||
|
Call to action
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 mb-5 mb-lg-0">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-building"></i></div>
|
||||||
|
<svg position=relative float=left width=150 class="col-auto" src="{% include 'pics/megamillions.svg'%}"></svg>
|
||||||
|
<p>Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.</p>
|
||||||
|
<a class="text-decoration-none" href="#!">
|
||||||
|
Call to action
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-toggles2"></i></div>
|
||||||
|
<svg position=relative float=left width=150 class="col-auto" src="{% include 'pics/lotto_america.svg'%}"></svg>
|
||||||
|
<p>Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.</p>
|
||||||
|
<a class="text-decoration-none" href="#!">
|
||||||
|
Call to action
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 mb-5 mb-lg-0">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-collection"></i></div>
|
||||||
|
<svg position=relative float=left width=150 class="col-auto" src="{% include 'pics/daily4.svg'%}"></svg>
|
||||||
|
<p>Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.</p>
|
||||||
|
<a class="text-decoration-none" href="#!">
|
||||||
|
Call to action
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 mb-5 mb-lg-0">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-building"></i></div>
|
||||||
|
<svg position=relative float=left width=150 class="col-auto" src="{% include 'pics/daily3.svg'%}"></svg>
|
||||||
|
<p>Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.</p>
|
||||||
|
<a class="text-decoration-none" href="#!">
|
||||||
|
Call to action
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4">
|
||||||
|
<div class="feature bg-primary bg-gradient text-white rounded-3 mb-3"><i class="bi bi-toggles2"></i></div>
|
||||||
|
<svg position=relative float=left width=150 class="col-auto" src="{% include 'pics/cash25.svg'%}"></svg>
|
||||||
|
<p>Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.</p>
|
||||||
|
<a class="text-decoration-none" href="#!">
|
||||||
|
Call to action
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<h6 class="card-footer" text-align=bottom>Disclaimer: WV Lottopy developers do not guarantee a win on the first or even the fortieth set of numbers. This is used to gain an <b><i>edge </i></b> over those who do not use this program.</h6>
|
||||||
|
{% endblock content %}
|
||||||
Reference in new issue
Block a user