diff --git a/data/BravoRanking.db b/data/BravoRanking.db index 2f2a3d86..f434fed3 100644 Binary files a/data/BravoRanking.db and b/data/BravoRanking.db differ diff --git a/data/json/matches/Burkina Faso.json b/data/json/matches/Burkina Faso.json index 81b7f5da..7649a4b1 100644 --- a/data/json/matches/Burkina Faso.json +++ b/data/json/matches/Burkina Faso.json @@ -1,6 +1,23 @@ { "team": "Burkina Faso", "matches": [ + { + "date": "2024-01-30", + "country": "Ivory Coast", + "tournament": "African Nations Cup", + "team1": "Burkina Faso", + "team2": "Mali", + "original_team1": "Burkina Faso", + "original_team2": "Mali", + "flag1": "burkina.png", + "flag2": "mali.png", + "score1": 1, + "score2": 2, + "rating1": 5003, + "rating2": 5131, + "rating_ev": -7, + "win_prob": 37.7 + }, { "date": "2024-01-23", "country": "Ivory Coast", diff --git a/data/json/matches/Mali.json b/data/json/matches/Mali.json index 52b5ca2a..6b058673 100644 --- a/data/json/matches/Mali.json +++ b/data/json/matches/Mali.json @@ -1,6 +1,23 @@ { "team": "Mali", "matches": [ + { + "date": "2024-01-30", + "country": "Ivory Coast", + "tournament": "African Nations Cup", + "team1": "Mali", + "team2": "Burkina Faso", + "original_team1": "Mali", + "original_team2": "Burkina Faso", + "flag1": "mali.png", + "flag2": "burkina.png", + "score1": 2, + "score2": 1, + "rating1": 5131, + "rating2": 5003, + "rating_ev": 7, + "win_prob": 62.3 + }, { "date": "2024-01-24", "country": "Ivory Coast", diff --git a/data/json/matches/Saudi Arabia.json b/data/json/matches/Saudi Arabia.json index b12bfad5..43f10612 100644 --- a/data/json/matches/Saudi Arabia.json +++ b/data/json/matches/Saudi Arabia.json @@ -1,6 +1,23 @@ { "team": "Saudi Arabia", "matches": [ + { + "date": "2024-01-30", + "country": "Qatar", + "tournament": "Asian Cup", + "team1": "Saudi Arabia", + "team2": "South Korea", + "original_team1": "Saudi Arabia", + "original_team2": "South Korea", + "flag1": "saudi_arabia.png", + "flag2": "south_korea.png", + "score1": 1, + "score2": 1, + "rating1": 5038, + "rating2": 5210, + "rating_ev": 12, + "win_prob": 29.7 + }, { "date": "2024-01-25", "country": "Qatar", diff --git a/data/json/matches/South Korea.json b/data/json/matches/South Korea.json index 2219b69f..25a35bd5 100644 --- a/data/json/matches/South Korea.json +++ b/data/json/matches/South Korea.json @@ -1,6 +1,23 @@ { "team": "South Korea", "matches": [ + { + "date": "2024-01-30", + "country": "Qatar", + "tournament": "Asian Cup", + "team1": "South Korea", + "team2": "Saudi Arabia", + "original_team1": "South Korea", + "original_team2": "Saudi Arabia", + "flag1": "south_korea.png", + "flag2": "saudi_arabia.png", + "score1": 1, + "score2": 1, + "rating1": 5210, + "rating2": 5038, + "rating_ev": -12, + "win_prob": 70.3 + }, { "date": "2024-01-25", "country": "Qatar", diff --git a/data/json/matches/Thailand.json b/data/json/matches/Thailand.json index 44b0922a..9d900eba 100644 --- a/data/json/matches/Thailand.json +++ b/data/json/matches/Thailand.json @@ -1,6 +1,23 @@ { "team": "Thailand", "matches": [ + { + "date": "2024-01-30", + "country": "Qatar", + "tournament": "Asian Cup", + "team1": "Thailand", + "team2": "Uzbekistan", + "original_team1": "Thailand", + "original_team2": "Uzbekistan", + "flag1": "thailand.png", + "flag2": "uzbekistan.png", + "score1": 1, + "score2": 2, + "rating1": 4776, + "rating2": 5104, + "rating_ev": 6, + "win_prob": 18.6 + }, { "date": "2024-01-25", "country": "Qatar", diff --git a/data/json/matches/Uzbekistan.json b/data/json/matches/Uzbekistan.json index 8a6a7602..7fcc483e 100644 --- a/data/json/matches/Uzbekistan.json +++ b/data/json/matches/Uzbekistan.json @@ -1,6 +1,23 @@ { "team": "Uzbekistan", "matches": [ + { + "date": "2024-01-30", + "country": "Qatar", + "tournament": "Asian Cup", + "team1": "Uzbekistan", + "team2": "Thailand", + "original_team1": "Uzbekistan", + "original_team2": "Thailand", + "flag1": "uzbekistan.png", + "flag2": "thailand.png", + "score1": 2, + "score2": 1, + "rating1": 5104, + "rating2": 4776, + "rating_ev": -6, + "win_prob": 81.4 + }, { "date": "2024-01-23", "country": "Qatar", diff --git a/data/json/rankings/LastRankings.json b/data/json/rankings/LastRankings.json index a3e59255..fc318ed3 100644 --- a/data/json/rankings/LastRankings.json +++ b/data/json/rankings/LastRankings.json @@ -1,7 +1,7 @@ { "year": "last", "last_date": [ - "2024-01-29" + "2024-01-30" ], "rankings": [ { @@ -204,16 +204,6 @@ "ranking_change": 1, "points_change": 0 }, - { - "ranking": 21, - "flag": "hungary.png", - "team": "Hungary", - "reference_team": "Hungary", - "points": 5311, - "confederation": "UEFA", - "ranking_change": 1, - "points_change": 0 - }, { "ranking": 21, "flag": "denmark.png", @@ -225,13 +215,13 @@ "points_change": 0 }, { - "ranking": 23, - "flag": "norway.png", - "team": "Norway", - "reference_team": "Norway", - "points": 5298, + "ranking": 21, + "flag": "hungary.png", + "team": "Hungary", + "reference_team": "Hungary", + "points": 5311, "confederation": "UEFA", - "ranking_change": 2, + "ranking_change": 1, "points_change": 0 }, { @@ -244,6 +234,16 @@ "ranking_change": -3, "points_change": -16 }, + { + "ranking": 23, + "flag": "norway.png", + "team": "Norway", + "reference_team": "Norway", + "points": 5298, + "confederation": "UEFA", + "ranking_change": 2, + "points_change": 0 + }, { "ranking": 25, "flag": "iran.png", @@ -356,34 +356,34 @@ }, { "ranking": 36, - "flag": "south_korea.png", - "team": "South Korea", - "reference_team": "South Korea", - "points": 5222, - "confederation": "AFC", - "ranking_change": -9, - "points_change": -55 - }, - { - "ranking": 37, "flag": "panama.png", "team": "Panama", "reference_team": "Panama", "points": 5219, "confederation": "CONCACAF", - "ranking_change": 1, + "ranking_change": 2, "points_change": 0 }, { - "ranking": 38, + "ranking": 37, "flag": "slovenia.png", "team": "Slovenia", "reference_team": "Slovenia", "points": 5214, "confederation": "UEFA", - "ranking_change": 4, + "ranking_change": 5, "points_change": 14 }, + { + "ranking": 38, + "flag": "south_korea.png", + "team": "South Korea", + "reference_team": "South Korea", + "points": 5210, + "confederation": "AFC", + "ranking_change": -11, + "points_change": -67 + }, { "ranking": 39, "flag": "paraguay.png", @@ -516,24 +516,24 @@ }, { "ranking": 52, + "flag": "mali.png", + "team": "Mali", + "reference_team": "Mali", + "points": 5131, + "confederation": "CAF", + "ranking_change": 3, + "points_change": 24 + }, + { + "ranking": 53, "flag": "egypt.png", "team": "Egypt", "reference_team": "Egypt", "points": 5124, "confederation": "CAF", - "ranking_change": -6, + "ranking_change": -7, "points_change": -47 }, - { - "ranking": 52, - "flag": "mali.png", - "team": "Mali", - "reference_team": "Mali", - "points": 5124, - "confederation": "CAF", - "ranking_change": 3, - "points_change": 17 - }, { "ranking": 54, "flag": "albania.png", @@ -549,10 +549,10 @@ "flag": "uzbekistan.png", "team": "Uzbekistan", "reference_team": "Uzbekistan", - "points": 5110, + "points": 5104, "confederation": "AFC", "ranking_change": 0, - "points_change": 3 + "points_change": -3 }, { "ranking": 56, @@ -655,25 +655,25 @@ "points_change": -67 }, { - "ranking": 66, + "ranking": 65, + "flag": "saudi_arabia.png", + "team": "Saudi Arabia", + "reference_team": "Saudi Arabia", + "points": 5038, + "confederation": "AFC", + "ranking_change": -2, + "points_change": -11 + }, + { + "ranking": 67, "flag": "iceland.png", "team": "Iceland", "reference_team": "Iceland", "points": 5032, "confederation": "UEFA", - "ranking_change": 2, + "ranking_change": 1, "points_change": 17 }, - { - "ranking": 67, - "flag": "saudi_arabia.png", - "team": "Saudi Arabia", - "reference_team": "Saudi Arabia", - "points": 5026, - "confederation": "AFC", - "ranking_change": -4, - "points_change": -23 - }, { "ranking": 68, "flag": "dr_congo.png", @@ -686,34 +686,34 @@ }, { "ranking": 69, - "flag": "burkina.png", - "team": "Burkina Faso", - "reference_team": "Burkina Faso", - "points": 5010, - "confederation": "CAF", - "ranking_change": -2, - "points_change": -15 - }, - { - "ranking": 70, "flag": "cape_verde.png", "team": "Cape Verde", "reference_team": "Cape Verde", "points": 5007, "confederation": "CAF", - "ranking_change": 11, + "ranking_change": 12, "points_change": 62 }, { - "ranking": 71, + "ranking": 70, "flag": "eq_guinea.png", "team": "Equatorial Guinea", "reference_team": "Equatorial Guinea", "points": 5005, "confederation": "CAF", - "ranking_change": 9, + "ranking_change": 10, "points_change": 56 }, + { + "ranking": 71, + "flag": "burkina.png", + "team": "Burkina Faso", + "reference_team": "Burkina Faso", + "points": 5003, + "confederation": "CAF", + "ranking_change": -4, + "points_change": -22 + }, { "ranking": 72, "flag": "costa_rica.png", @@ -1004,16 +1004,6 @@ "ranking_change": 6, "points_change": 4 }, - { - "ranking": 101, - "flag": "uganda.png", - "team": "Uganda", - "reference_team": "Uganda", - "points": 4838, - "confederation": "CAF", - "ranking_change": 11, - "points_change": 12 - }, { "ranking": 101, "flag": "tanzania.png", @@ -1024,6 +1014,16 @@ "ranking_change": 7, "points_change": 5 }, + { + "ranking": 101, + "flag": "uganda.png", + "team": "Uganda", + "reference_team": "Uganda", + "points": 4838, + "confederation": "CAF", + "ranking_change": 11, + "points_change": 12 + }, { "ranking": 101, "flag": "zimbabwe.png", @@ -1034,6 +1034,16 @@ "ranking_change": 2, "points_change": 0 }, + { + "ranking": 104, + "flag": "benin.png", + "team": "Benin", + "reference_team": "Benin", + "points": 4837, + "confederation": "CAF", + "ranking_change": 0, + "points_change": 0 + }, { "ranking": 104, "flag": "syria.png", @@ -1045,13 +1055,13 @@ "points_change": 15 }, { - "ranking": 104, - "flag": "benin.png", - "team": "Benin", - "reference_team": "Benin", - "points": 4837, - "confederation": "CAF", - "ranking_change": 0, + "ranking": 106, + "flag": "salvador.png", + "team": "El Salvador", + "reference_team": "El Salvador", + "points": 4836, + "confederation": "CONCACAF", + "ranking_change": -1, "points_change": 0 }, { @@ -1064,16 +1074,6 @@ "ranking_change": 4, "points_change": 5 }, - { - "ranking": 106, - "flag": "salvador.png", - "team": "El Salvador", - "reference_team": "El Salvador", - "points": 4836, - "confederation": "CONCACAF", - "ranking_change": -1, - "points_change": 0 - }, { "ranking": 106, "flag": "palestine.png", @@ -1276,34 +1276,34 @@ }, { "ranking": 128, + "flag": "thailand.png", + "team": "Thailand", + "reference_team": "Thailand", + "points": 4776, + "confederation": "AFC", + "ranking_change": 13, + "points_change": 46 + }, + { + "ranking": 129, "flag": "vietnam.png", "team": "Vietnam", "reference_team": "Vietnam", "points": 4774, "confederation": "AFC", - "ranking_change": -7, + "ranking_change": -8, "points_change": -22 }, { - "ranking": 129, + "ranking": 130, "flag": "sudan.png", "team": "Sudan", "reference_team": "Sudan", "points": 4772, "confederation": "CAF", - "ranking_change": 1, + "ranking_change": 0, "points_change": 0 }, - { - "ranking": 130, - "flag": "thailand.png", - "team": "Thailand", - "reference_team": "Thailand", - "points": 4770, - "confederation": "AFC", - "ranking_change": 11, - "points_change": 40 - }, { "ranking": 131, "flag": "nicaragua.png", @@ -1354,6 +1354,16 @@ "ranking_change": 0, "points_change": 0 }, + { + "ranking": 136, + "flag": "comoros.png", + "team": "Comoros", + "reference_team": "Comoros", + "points": 4747, + "confederation": "CAF", + "ranking_change": 0, + "points_change": 0 + }, { "ranking": 136, "flag": "cyprus.png", @@ -1374,16 +1384,6 @@ "ranking_change": 2, "points_change": 8 }, - { - "ranking": 136, - "flag": "comoros.png", - "team": "Comoros", - "reference_team": "Comoros", - "points": 4747, - "confederation": "CAF", - "ranking_change": 0, - "points_change": 0 - }, { "ranking": 139, "flag": "kuwait.png", @@ -1424,16 +1424,6 @@ "ranking_change": 0, "points_change": 0 }, - { - "ranking": 143, - "flag": "north_korea.png", - "team": "North Korea", - "reference_team": "North Korea", - "points": 4716, - "confederation": "AFC", - "ranking_change": 1, - "points_change": 0 - }, { "ranking": 143, "flag": "lesotho.png", @@ -1444,6 +1434,16 @@ "ranking_change": 0, "points_change": -2 }, + { + "ranking": 143, + "flag": "north_korea.png", + "team": "North Korea", + "reference_team": "North Korea", + "points": 4716, + "confederation": "AFC", + "ranking_change": 1, + "points_change": 0 + }, { "ranking": 145, "flag": "suriname.png", diff --git a/scripts/020_DB_Update/021_Extract_Data_Source.py b/scripts/020_DB_Update/021_Extract_Data_Source.py index f951b3b1..2170f4c9 100644 --- a/scripts/020_DB_Update/021_Extract_Data_Source.py +++ b/scripts/020_DB_Update/021_Extract_Data_Source.py @@ -116,7 +116,7 @@ teams_query = f"SELECT DISTINCT r.team, t.reference_team, r.points, t.startDate, t.endDate FROM Rankings r LEFT JOIN Teams t ON (r.team = t.team) WHERE year = {last_year} AND month = {last_month} AND day = {last_day}" teams_sql = pd.read_sql(teams_query, conn) - teams_last_level['team'] = teams_sql['reference_team'] + teams_last_level['reference_team'] = teams_sql['reference_team'] teams_last_level['points'] = teams_sql['points'] conn.close() @@ -125,8 +125,6 @@ # We generate a unique dataset file for the following steps teams_db = teams_excel.merge(teams_last_level, on='reference_team') -teams_db = teams_db.rename(columns={'team_x': 'team'}) -teams_db = teams_db.drop('team_y', axis=1) # Save the datasets in temp csv files matches.to_csv('data/temp/matches.csv', index=False)