<jupyter_start><jupyter_text>Import `final` dataset<jupyter_code>final = pd.read_csv("../final.csv")
final.head()<jupyter_output><empty_output><jupyter_text>Add avg goals statistic to dataset<jupyter_code>home_avg_goals = []
away_avg_goals = []

for i in range(len(final)):
    home_team_name = final["Home Team Name"][i]
    away_team_name = final["Away Team Name"][i]

    avg_goals = get_average_goals(home_team_name, away_team_name, final["Year"][i]-1)
    if avg_goals:
        home_avg_goals.append(avg_goals[0])
        away_avg_goals.append(avg_goals[1])
    else:
        home_avg_goals.append(0.0)
        away_avg_goals.append(0.0)
final["Home Avg Goals"] = home_avg_goals
final["Away Avg Goals"] = away_avg_goals
final.head()<jupyter_output><empty_output><jupyter_text>Save datasets into CSV files<jupyter_code>final.to_csv("../final.csv", index=0)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13707865168539327, 'fraction_numerical': 0.008988764044943821, 'mean_word_length': 5.801526717557252, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '351381', 'license': 'MIT', 'n_tokens_mistral': 361, 'n_tokens_neox': 353, 'n_words': 48, 'path': 'DataFormating/football_statistics/add_avg_goals.ipynb', 'repo_name': 'VIVelev/WorldCup-Prediction', 'size': '890'}