ITADN

Some date's drawings are missing

#2Closedgwangjinkim 创建于 2024-08-16
G
gwangjinkimcommented
Dear Johannes, Thank you for the nice work! I was trying something like: ``` import pandas as pd data = pd.read_json("https://johannesfriedrich.github.io/LottoNumberArchive/Lottonumbers_tidy_complete.json") def get_number(date, data): return data.loc[data.date == date, :] def get_number_list(date, data): df = get_number(date, data) assert [x for x in df.variable] == ['Lottozahl']*6 + ['Superzahl'] return [x for x in df.value] def check_richtige(my_num, result_num): n1, n2, n3, n4, n5, n6, sz = result_num m1, m2, m3, m4, m5, m6, msz = my_num intersect = set([n1, n2, n3, n4, n5, n6]).intersection(set([m1, m2, m3, m4, m5, m6])) return intersect, sz == msz def check_date(date, data, my_num): return check_richtige(my_num, get_number_list(date, data)) my_num1 = [1, 4, 17, 31, 33, 49, 1] my_num2 = [2, 5, 18, 32, 34, 48, 1] def to_date(date): return datetime.strptime(str(date)[:10], '%Y-%m-%d') def filter_dates(date_list, start_date, end_date): return [str(x)[:10] for x in date_list if to_date(start_date) <= to_date(x) <= to_date(end_date)] dates = ['2024-03-27', '2024-03-30', '2024-04-03', '2024-04-06', '2024-04-10', '2024-04-13'] for d in dates: check_date(d, data, my_num1) check_date(d, data, my_num2) ``` But some of the April drawings were missing. No obvious reasons. I pulled manually the numbers: ``` data_man = {'2024-03-27': [2, 13, 20, 32, 41, 44, 2], '2024-03-30': [5, 10, 16, 21, 27, 33, 0], '2024-04-03': [2, 3, 29, 31, 35, 36, 9], '2024-04-06': [7, 11, 13, 20, 35, 41, 0], '2024-04-10': [7, 8, 13, 43, 47, 49, 2], '2024-04-13': [3, 6, 10, 32, 33, 47, 0] } for d in dates: print(f"{set(data_man[d][:6]).intersection(set(my_num1[:6]))} {data_man[d][6:7] == my_num1[6:7]}") ``` Also I tried another area: ``` sorted([x for x in set(filter_dates(data.date, '2024-05-22', '2024-06-24'))]) Out[69]: ['2024-05-22', '2024-05-25', '2024-05-29', '2024-06-01', '2024-06-03', '2024-06-04', '2024-06-07', '2024-06-15', '2024-06-19', '2024-06-22'] ``` The date '2024-06-10' and '2024-06-12' e.g. are missing. so I manually collected: ``` data2 = {'2024-05-22': [8, 9, 10, 15, 38, 47, 4], '2024-05-25': [8, 15, 24, 32, 38, 41, 5], '2024-05-29': [3, 5, 11, 12, 28, 44, 6], '2024-06-01': [8, 9, 10, 27, 35, 41, 0], '2024-06-05': [10, 11, 16, 19, 26, 33, 5], '2024-06-08': [5, 10, 15, 22, 31, 40, 9], '2024-06-12': [5, 9, 10, 11, 22, 46, 2], '2024-06-15': [3, 16, 30, 31, 38, 49, 8], } # '2024-06-19': [1, 4, 12, 30, 32, 43, 4], # '2024-06-22': [8, 9, 11, 21, 25, 30, 1]} my_num3 = [1, 4, 9, 19, 31, 33, 0] my_num4 = [1, 4, 23, 33, 41, 49, 0] def print_intersect(date, dct, my_num): print(f"date: {date}, num: {dct[date]}, my_num: {my_num}, result: {set(dct[date][:6]).intersection(set(my_num[:6]))}, {dct[date][6:] == my_num[6:]}") for d in data2.keys(): print_intersect(d, data2, my_num3) print_intersect(d, data2, my_num4) ``` Also in this time stretch several drawings are missing in the actualized json. How these drawings happened to get missed?
关闭于 2024-08-16 3 条评论