painful repo management
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# wvlottopy
|
||||
|
||||
THE WVLOTTOPY DEVELOPERS HAVE NO AFFILIATION WITH THE WEST VIRGINIA STATE LOTTERY
|
||||
|
||||
This script generates the most likely lottery numbers based off frequency of winning numbers.
|
||||
|
||||
Previously there were records dating back to 1992 that were removed by the website, which has lead me to rewrite and encourage the collaboration and sharing of this work. I will attach an excel file in the near future that includes the previous records and soon try to reincorperate them into the script. Originally excel functionality was stripped for performance.
|
||||
|
||||
I am welcoming anyone who wants to to port it to their own state/country to do so. I currently have a website www.wvlotterypredictor.xyz hosting my numbers to be refreshed daily. Collaboration and suggestion to a more accurate algorithm is also welcome.
|
||||
|
||||
#Good luck!
|
||||
@@ -0,0 +1,45 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
import pandas as pd
|
||||
import requests
|
||||
from collections import Counter
|
||||
|
||||
def get_data():
|
||||
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
|
||||
df = dfs[0]
|
||||
df2 = df[['Date', 'Numbers']]
|
||||
date = list(df2['Date'])
|
||||
nums = list(df2['Numbers'].astype('str'))
|
||||
return date, nums
|
||||
|
||||
date, nums = get_data()
|
||||
|
||||
# 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]
|
||||
|
||||
sorted_nums = sorted(likely_nums)
|
||||
total_freq = sum(frequency)
|
||||
Chance = frac(total_freq, 177100) # Chance = number call freq / all possible numbers i.e. 177100
|
||||
Winning_Numbers = str("-".join(sorted_nums))
|
||||
|
||||
print(f"Likely numbers are . . . {Winning_Numbers} \n"
|
||||
f"With percent chance of winning being {Chance}")
|
||||
@@ -0,0 +1,44 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
import pandas as pd
|
||||
import requests
|
||||
from collections import Counter
|
||||
|
||||
def get_data():
|
||||
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
|
||||
df = dfs[0]
|
||||
df2 = df[['Date', 'Numbers']]
|
||||
date = list(df2['Date'])
|
||||
nums = list(df2['Numbers'].astype('str'))
|
||||
return date, nums
|
||||
|
||||
date, nums = get_data()
|
||||
|
||||
# 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]
|
||||
|
||||
sorted_nums = sorted(likely_nums)
|
||||
total_freq = sum(frequency)
|
||||
Chance = frac(total_freq, 1000) # Chance = number call freq / all possible numbers i.e. 1000
|
||||
Winning_Numbers = str("-".join(sorted_nums))
|
||||
|
||||
print(f"Likely numbers are . . . {Winning_Numbers} \n"
|
||||
f"With percent chance of winning being {Chance}")
|
||||
@@ -0,0 +1,44 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
import pandas as pd
|
||||
import requests
|
||||
from collections import Counter
|
||||
|
||||
def get_data():
|
||||
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
|
||||
df = dfs[0]
|
||||
df2 = df[['Date', 'Numbers']]
|
||||
date = list(df2['Date'])
|
||||
nums = list(df2['Numbers'].astype('str'))
|
||||
return date, nums
|
||||
|
||||
date, nums = get_data()
|
||||
|
||||
# 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]
|
||||
|
||||
sorted_nums = sorted(likely_nums)
|
||||
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"
|
||||
f"With percent chance of winning being {Chance}")
|
||||
Executable
+51
@@ -0,0 +1,51 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
import pandas as pd
|
||||
import requests
|
||||
from collections import Counter
|
||||
|
||||
def get_data():
|
||||
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
|
||||
df = dfs[0]
|
||||
df2 = df[['Date', 'Numbers', 'SB', 'All Star']]
|
||||
date = list(df2['Date'])
|
||||
nums = list(df2['Numbers'].astype('str'))
|
||||
SBs = list(df2['SB'].astype('int'))
|
||||
return date, nums, SBs
|
||||
|
||||
date, nums, SBs = get_data()
|
||||
|
||||
# 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_sb = Counter(SBs).most_common(1)
|
||||
SB = [v[0] for v in most_common_sb]
|
||||
frequency_sb = [v[-1] for v in most_common_sb]
|
||||
|
||||
sorted_nums = sorted(likely_nums)
|
||||
total_freq = sum(frequency + frequency_sb)
|
||||
Chance = frac(total_freq, 25989600) # Chance = number call freq / all possible numbers i.e. 25,989,600
|
||||
Winning_Numbers = str("-".join(sorted_nums))
|
||||
|
||||
print(f"Likely numbers are . . . {Winning_Numbers} SB: {SB}\n"
|
||||
f"With percent chance of winning being {Chance}")
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
import pandas as pd
|
||||
import requests
|
||||
from collections import Counter
|
||||
|
||||
def get_data():
|
||||
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
|
||||
df = dfs[0]
|
||||
df2 = df[['Date', 'Numbers', 'PB', 'PPX', 'Winners WV Only', 'Payout WV Only']]
|
||||
date = list(df2['Date'])
|
||||
nums = list(df2['Numbers'].astype('str'))
|
||||
PBs = list(df2['PB'].astype('int'))
|
||||
return date, nums, PBs
|
||||
|
||||
date, nums, PBs = get_data()
|
||||
|
||||
# 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(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)
|
||||
total_freq = sum(frequency + frequency_pb)
|
||||
Chance = frac(total_freq, 292201338) # Chance = number call freq / all possible numbers i.e. 292201338
|
||||
Winning_Numbers = str("-".join(sorted_nums))
|
||||
|
||||
print(f"Likely numbers are . . . {Winning_Numbers} PB: {PB}\n"
|
||||
f"With percent chance of winning being {Chance}")
|
||||
Executable
+51
@@ -0,0 +1,51 @@
|
||||
# WVLottopy megamil: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
import pandas as pd
|
||||
import requests
|
||||
from collections import Counter
|
||||
|
||||
def get_data():
|
||||
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
|
||||
df = dfs[0]
|
||||
df2 = df[['Date', 'Numbers', 'MB', 'MP']]
|
||||
date = list(df2['Date'])
|
||||
nums = list(df2['Numbers'].astype('str'))
|
||||
MBs = list(df2['MB'].astype('int'))
|
||||
return date, nums, MBs
|
||||
|
||||
date, nums, MBs = get_data()
|
||||
|
||||
# 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_mb = Counter(MBs).most_common(1)
|
||||
MB = [v[0] for v in most_common_mb]
|
||||
frequency_mb = [v[-1] for v in most_common_mb]
|
||||
|
||||
sorted_nums = sorted(likely_nums)
|
||||
total_freq = sum(frequency + frequency_mb)
|
||||
Chance = frac(total_freq, 302575350) # Chance = number call freq / all possible numbers i.e. 11238513
|
||||
Winning_Numbers = str("-".join(sorted_nums))
|
||||
|
||||
print(f"Likely numbers are . . . {Winning_Numbers} MB: {MB}\n"
|
||||
f"With percent chance of winning being {Chance}")
|
||||
@@ -0,0 +1,2 @@
|
||||
pandas==1.3.5
|
||||
requests==2.26.0
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# Simple start script for lottopy designed by Matteo DiBiagio
|
||||
# www.wvlotterypredictor.xyz
|
||||
# MIT License
|
||||
# Edit to your need
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user