fix: 修改业务逻辑代码
This commit is contained in:
parent
0b5be379c4
commit
9655da0df7
|
|
@ -0,0 +1,28 @@
|
||||||
|
import itertools
|
||||||
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
# 前区
|
||||||
|
res1 = list(itertools.combinations(range(1, 36), 5))
|
||||||
|
sum_res1_df = pd.value_counts([ sum(map(int, list(i))) for i in res1])
|
||||||
|
# print(sum_res1_df[:20])
|
||||||
|
|
||||||
|
sum_res1_dict = {i: [] for i in np.arange(15, 166)}
|
||||||
|
for i in res1:
|
||||||
|
sum_res1_dict[sum(i)].append(i)
|
||||||
|
|
||||||
|
f = lambda item: True if max(item) > 29 else False
|
||||||
|
arr = list(filter(f, sum_res1_dict[92]))
|
||||||
|
|
||||||
|
# print(len(sum_res1_dict[72]))
|
||||||
|
|
||||||
|
|
||||||
|
# 后区
|
||||||
|
res2 = list(itertools.combinations(range(1, 13), 2))
|
||||||
|
sum_res2_df = pd.value_counts([ sum(map(int, list(i))) for i in res2])
|
||||||
|
print(len(sum_res2_df))
|
||||||
|
|
||||||
|
sum_res2_dict = {i: [] for i in np.arange(3, 24)}
|
||||||
|
for i in res2:
|
||||||
|
sum_res2_dict[sum(i)].append(i)
|
||||||
|
print(sum_res2_dict)
|
||||||
15
get_data.py
15
get_data.py
|
|
@ -1,7 +1,6 @@
|
||||||
from requests_html import HTML, HTMLSession
|
from requests_html import HTML, HTMLSession
|
||||||
from retrying import retry
|
from retrying import retry
|
||||||
from sqlalchemy import create_engine
|
|
||||||
from sqlalchemy.orm import sessionmaker
|
|
||||||
|
|
||||||
from lottery import Lottery
|
from lottery import Lottery
|
||||||
|
|
||||||
|
|
@ -47,6 +46,12 @@ if __name__ == '__main__':
|
||||||
# url = "https://kaijiang.500.com/shtml/sd/04001.shtml"
|
# url = "https://kaijiang.500.com/shtml/sd/04001.shtml"
|
||||||
# url = "https://kaijiang.500.com/shtml/plw/04001.shtml"
|
# url = "https://kaijiang.500.com/shtml/plw/04001.shtml"
|
||||||
# main(url, lottery_type='plw')
|
# main(url, lottery_type='plw')
|
||||||
for i in range(22320, 22321):
|
for y in range(24, 25):
|
||||||
url = f"https://kaijiang.500.com/shtml/pls/{i}.shtml"
|
for i in range(1, 365):
|
||||||
get_data(url, lottery_type= 'pls')
|
try :
|
||||||
|
issue = str(y) + f"{i:03d}"
|
||||||
|
url = f"https://kaijiang.500.com/shtml/pls/{issue}.shtml"
|
||||||
|
get_data(url, lottery_type='pls')
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
break
|
||||||
38
pls.py
38
pls.py
|
|
@ -9,7 +9,7 @@ l = set([ "".join(sorted(f"{i:03d}")) for i in a ])
|
||||||
sum_list = [ sum(map(int, list(i))) for i in l]
|
sum_list = [ sum(map(int, list(i))) for i in l]
|
||||||
sum_df = pd.value_counts(sum_list)
|
sum_df = pd.value_counts(sum_list)
|
||||||
# print(sum_df.to_dict())
|
# print(sum_df.to_dict())
|
||||||
# print((220/sum_df).to_dict())
|
print((220/sum_df).to_dict())
|
||||||
|
|
||||||
# 组三
|
# 组三
|
||||||
group3 = [ i for i in l if len(set(i)) == 2]
|
group3 = [ i for i in l if len(set(i)) == 2]
|
||||||
|
|
@ -34,21 +34,35 @@ for i in group6:
|
||||||
for i in sum_group6_dict.keys():
|
for i in sum_group6_dict.keys():
|
||||||
f1 = lambda number: len([i for i in number if int(i) %2 == 0]) != 0
|
f1 = lambda number: len([i for i in number if int(i) %2 == 0]) != 0
|
||||||
f2 = lambda number: len([i for i in number if int(i) %2 == 1]) != 0
|
f2 = lambda number: len([i for i in number if int(i) %2 == 1]) != 0
|
||||||
f3 = lambda number: True if max(map(int, number)) - min(map(int, number)) != 2 else False
|
f3 = lambda n: True if int(n[1]) - int(n[0]) == 1 or int(n[2]) - int(n[1]) == 1 else False
|
||||||
f4 = lambda number: True if '3' not in number else False
|
f4 = lambda number: True if 'a' not in number else False
|
||||||
f5 = lambda number: True if '7' not in number else False
|
f5 = lambda number: True if '2' in number or '8' in number else False
|
||||||
f6 = lambda number: True if len(set('279').difference(number)) == 2 else False
|
f6 = lambda number: True if len(set('279').difference(number)) == 2 else False
|
||||||
if i in [12, 13, 16]:
|
if i in [12,14, 15, 16, 17]:
|
||||||
# result = sum_group6_dict[i] + sum_group3_dict[i]
|
# result = sum_group6_dict[i] + sum_group3_dict[i]
|
||||||
result = sum_group3_dict[i]
|
result = sum_group3_dict[i]
|
||||||
# print(i, list(filter(f5, result)))
|
print("-"*15 + "组三" + "-"*15)
|
||||||
result = sum_group6_dict[i]
|
|
||||||
print(i, list(filter(f5, result)))
|
print(i, list(filter(f5, result)))
|
||||||
|
result = sum_group6_dict[i]
|
||||||
|
print("-"*15 + "组六" + "-"*15)
|
||||||
|
print(i, list(filter(f5, result)))
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
# 连号
|
# 连号
|
||||||
result = []
|
result_1 = []
|
||||||
for i in l:
|
# 大大小
|
||||||
a = np.array(list(map(int, i)))
|
result_2 = []
|
||||||
if int(np.max(a) - np.median(a)) == 1 or int(np.median(a) - np.min(a)) == 1:
|
for i in a:
|
||||||
result.append(i)
|
item = "".join(sorted(f"{i:03d}"))
|
||||||
|
if int(item[2]) - int(item[1]) == 1 or int(item[1]) - int(item[0]) == 1:
|
||||||
|
result_1.append(i)
|
||||||
|
item_2 = f"{i:03d}"
|
||||||
|
if int(item_2[0]) > 4 and int(item_2[1]) > 4 and int(item_2[2]) <= 4:
|
||||||
|
result_2.append(i)
|
||||||
|
f = lambda number: True if '6' in f"{number:03d}" else False
|
||||||
|
arr = set([ "".join(sorted(f"{i:03d}")) for i in filter(f, result_1)])
|
||||||
|
# print(list(arr))
|
||||||
|
# print(len(result_1))
|
||||||
|
# print(len(result_2))
|
||||||
|
# print(result_2[:20])
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
import math
|
||||||
|
|
||||||
|
|
||||||
|
a = np.arange(100000)
|
||||||
|
l = set([ f"{i:05d}" for i in a ])
|
||||||
|
sum_list = [ sum(map(int, list(i))) for i in l]
|
||||||
|
sum_df = pd.value_counts(sum_list)
|
||||||
|
print(sum_df.to_dict())
|
||||||
|
print(np.ceil((100000/sum_df)).to_dict())
|
||||||
|
|
@ -259,8 +259,8 @@ class Chrome(object):
|
||||||
with Chrome() as chrome:
|
with Chrome() as chrome:
|
||||||
# chrome.balance()
|
# chrome.balance()
|
||||||
# 组选
|
# 组选
|
||||||
result = ['138', '048', '129', '246', '039', '238', '058', '139', '049', '148', '358', '259', '169', '349', '268']
|
result = ['348', '249', '168', '267', '078', '458', '368', '269', '089', '158', '239']
|
||||||
chrome.pls(result = result, multiple=1)
|
chrome.pls(result = result, multiple=2)
|
||||||
# 直选
|
# 直选
|
||||||
# result = ['925', '926', '278', '287', '219', '921', '327', '237', '274', '724']
|
# result = ['246', '264', '291', '219', '169']
|
||||||
# chrome.pls(result=result, is_group=False)
|
# chrome.pls(result=result, is_group=False)
|
||||||
Loading…
Reference in New Issue