slight changes, redis impl
This commit is contained in:
1 parent
e91ee1acbd
commit
cf3dc3ee35
31 files changed
+88
-43
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
Winning_Numbers,Chance
|
||||
14-18-22-23-5-9,[0.19480519480519481]
|
||||
14-18-22-23-5-9,347/177100
|
||||
|
@@ -1,4 +1,5 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
from sheet2dict import Worksheet
|
||||
import pandas as pd
|
||||
import requests
|
||||
@@ -69,7 +70,7 @@ 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 = frac(total_freq, 177100) # 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, "%")
|
||||
|
||||
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
Winning_Numbers,Chance
|
||||
0-4-6,[0.33]
|
||||
0-3-6,17/5000
|
||||
|
@@ -1,2 +1,2 @@
|
||||
Winning_Numbers,Chance
|
||||
3-5-6-8,[5.35]
|
||||
3-5-6-8,267/5000
|
||||
|
@@ -1,4 +1,5 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
from sheet2dict import Worksheet
|
||||
import pandas as pd
|
||||
import requests
|
||||
@@ -69,7 +70,7 @@ 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 = frac(total_freq, 10000) # 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, "%")
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,5 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
from sheet2dict import Worksheet
|
||||
import pandas as pd
|
||||
import requests
|
||||
@@ -69,7 +70,7 @@ 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 = frac(total_freq, 10000) # 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, "%")
|
||||
|
||||
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
Winning_Numbers,SB,Chance
|
||||
1-10-32-36-8,[3],[0.00036937852063902485]
|
||||
1-10-32-49-8,[3],1/270725
|
||||
|
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
#from django_lottopy.lottopy_site.lottopy.lottopy_web_edition.megamil import Winning_Numbers
|
||||
from fractions import Fraction as frac
|
||||
from sheet2dict import Worksheet
|
||||
import pandas as pd
|
||||
import requests
|
||||
@@ -70,7 +71,7 @@ for n in range(0, 10):
|
||||
|
||||
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 = frac(total_freq, 25989600) # 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, "%")
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,10 +1,14 @@
|
||||
# WVLottopy: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
from sheet2dict import Worksheet
|
||||
import pandas as pd
|
||||
import requests
|
||||
from collections import Counter
|
||||
import csv
|
||||
|
||||
def fraction_ratio(i):
|
||||
return i/sum(i)
|
||||
|
||||
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",
|
||||
@@ -69,7 +73,7 @@ for n in range(0, 26):
|
||||
|
||||
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
|
||||
Chance = frac(total_freq, 292201338) # 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, "%")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# WVLottopy megamil: Matteo DiBiagio
|
||||
from fractions import Fraction as frac
|
||||
from sheet2dict import Worksheet
|
||||
import pandas as pd
|
||||
import requests
|
||||
@@ -69,7 +70,7 @@ for n in range(0, 25):
|
||||
|
||||
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 = frac(total_freq, 302575350) # 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, "%")
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Winning_Numbers,MB,Chance
|
||||
17-21-26-52-7,[24],[2.478721416004311e-05]
|
||||
17-26-40-52-7,[24],1/4034338
|
||||
|
@@ -1,2 +1,2 @@
|
||||
Winning_Numbers,PB,Chance
|
||||
21-39-59-61-63,[17],[3.216959944242281e-05]
|
||||
21-33-39-59-63,[17],16/48700223
|
||||
|
@@ -2,7 +2,7 @@ from django.urls import path
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.base, name='base'),
|
||||
path('home/', views.home, name='home'),
|
||||
#path('', views.base, name='base'),
|
||||
path('', views.home, name='home'),
|
||||
path('about/', views.about, name="about"),
|
||||
]
|
||||
@@ -1,25 +1,22 @@
|
||||
# Create your views here.
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.conf import settings
|
||||
from django.core.cache.backends.base import DEFAULT_TIMEOUT
|
||||
from django.views.decorators.cache import cache_page
|
||||
import os
|
||||
import csv
|
||||
|
||||
#f = "~/projects/django_lottopy/lottopy_site/lottopy/lottopy_web_edititon/pb_ans.csv"
|
||||
|
||||
#def files(f):
|
||||
# reader = csv.DictReader(open(f))
|
||||
# for row in reader:
|
||||
# global numbers, pb, chance
|
||||
# numbers = row[0-5]
|
||||
# pb = row[6]
|
||||
# chance = row[7]
|
||||
# pbdata = pbdata(numbers=numbers,pb=pb,chance=chance)
|
||||
# pbdata.save()
|
||||
# MAKE SURE TO START REDIS BEFORE SITE LOADS
|
||||
|
||||
def base(request):
|
||||
return render(request, 'lottopy/base.html',
|
||||
{'nbar': 'home'})
|
||||
|
||||
CACHE_TTL = getattr(settings, 'CACHE_TTL', DEFAULT_TIMEOUT)
|
||||
@cache_page(CACHE_TTL)
|
||||
def home(request):
|
||||
# Powerball
|
||||
module_dir = os.path.dirname(__file__)
|
||||
@@ -77,7 +74,8 @@ def home(request):
|
||||
'lanumbers': lanumbers,
|
||||
'd3numbers': d3numbers,
|
||||
'd4numbers': d4numbers,
|
||||
'c25numbers': c25numbers
|
||||
'c25numbers': c25numbers,
|
||||
'active': 'active'
|
||||
}
|
||||
return render(request, 'lottopy/home.html', context)
|
||||
|
||||
|
||||
Reference in new issue
Block a user