-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiff.py
executable file
·75 lines (64 loc) · 1.9 KB
/
diff.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# from ortools.sat.python import cp_model
# import shutil
# from test import test_results_indexes
# from test import test_results
import logging
from utils import *
prev = read_excel("2024/results/v4/v2/results.xlsx")
# prev = read_excel("2024/results/v4/v1/play-cricket-normalised.xlsx")
# now = read_excel("2024/results/v3.xlsx")
now = read_excel("2024/results/v4/v2/play-cricket-normalised.xlsx")
results_file = "2024/results/v4/v2/diff.xlsx"
diffs = []
for i in prev:
if i not in now:
print (i)
i["type"] = "Removed"
diffs.append(i)
for i in now:
if i not in prev:
print (i)
i["type"] = "Added"
diffs.append(i)
write_excel(diffs, results_file)
##
# # norms = read_data("data.xlsx", "Grounds")
# # results = read_data("./results/backup/data.xlsx", "Grounds")
# # # print (results)
# # diff1 = [item for item in norms if item not in results]
# # diff2 = [item for item in results if item not in norms]
# # # return (len(diff1) + len(diff2))
# # print (diff1)
# # # print (diff1)
# rows_1 = read_data("./tmp/play-cricket-download.xlsx", "Fixtures")
# rows_2 = read_data("/Users/sahbab01/Downloads/download_fixtures (18).xlsx", "Fixtures")
# keys = [
# "Date",
# "Home Team",
# "Away Team",
# "Division / Cup",
# # "Ground"
# ]
# norm_1 = []
# for row in rows_1:
# r = {}
# for key in keys:
# r[key] = row[key]
# norm_1.append(r)
# norm_2 = []
# for row in rows_2:
# r = {}
# for key in keys:
# r[key] = row[key].replace("&", "and")
# norm_2.append(r)
# diff1 = [item for item in norm_1 if item not in norm_2]
# diff2 = [item for item in norm_2 if item not in norm_1]
# for i in diff1:
# print(i["Division / Cup"])
# print(len(diff1))
# print(len(diff2))
# print("++++++")
# # for i in diff2:
# # # if i["Division / Cup"] == "CCA Junior League 5 South":
# # # print (i)
# # print (i["Division / Cup"])