Update main.py
This commit is contained in:
parent
0c49629ac0
commit
c35d06ee68
6
main.py
6
main.py
|
@ -7,8 +7,8 @@ import pandas as pd
|
|||
import numpy as np
|
||||
from geneticalgorithm2 import geneticalgorithm2 as ga
|
||||
|
||||
cols = [1, 13, 14, 15, 16, 17, 18]
|
||||
df = pd.read_excel('excel.xlsx', skiprows=2, usecols=cols, names=[0, 1, 2, 3, 4, 5, 6])
|
||||
cols = [1, 13, 14, 15, 16, 17, 18, 19] # including bonus number
|
||||
df = pd.read_excel('excel.xlsx', skiprows=2, usecols=cols, names=[0, 1, 2, 3, 4, 5, 6, 7])
|
||||
rows = df.values[:10]
|
||||
|
||||
def make_num(x, n, a, b, c, min, max):
|
||||
|
@ -23,7 +23,7 @@ def f(X):
|
|||
for row in rows:
|
||||
x = row[0]
|
||||
N = row[1:]
|
||||
_N = [make_num(x, n, X[0], X[1], X[2], 1, 45) for n in range(1, 7)]
|
||||
_N = [make_num(x, n, X[0], X[1], X[2], 1, 45) for n in range(1, 8)] # including bonus number
|
||||
result = len(list(set(N) & set(_N)))
|
||||
if result > 5:
|
||||
score += 100
|
||||
|
|
Loading…
Reference in New Issue
Block a user