INNER CODE UNIT · Python
load_prem_fixtures_id
mhaythornthwaite/Football_Prediction_Project · 01_api_data_request.py:113
def load_prem_fixtures_id(year=YEAR_str):
premier_league_fixtures_df = read_json_as_pd_df(f'{year}_premier_league_fixtures.json', json_data_path='prem_clean_fixtures_and_dataframes/')
return premier_league_fixtures_df
fixtures = load_prem_fixtures_id()
#------------------------- MAKING CLEAN FIXTURE LIST --------------------------
fixtures = pd.read_json(f'prem_clean_fixtures_and_dataframes/{YEAR_str}_premier_league_fixtures.json', orient='records')
#creating clean past fixture list DataFrame
for i in fixtures.index:
x1 = str(fixtures['homeTeam'].iloc[i])[12:14]
x = int(x1)
fixtures.at[i, 'HomeTeamID'] = x