<jupyter_start><jupyter_text>Mahomes Mahomes = df.loc[(df["qb1"] == "<NAME>") | (df["qb2"] == "<NAME>")]<jupyter_code>Mahomes1 = df.loc[df["qb1"] == "<NAME>"]
Mahomes2 = df.loc[df["qb2"] == "<NAME>"]
Mahomes1["qb1_game_value"]
Mahomes2["qb1_game_value"]
mahomesQbScore1 = Mahomes1[["date","qb1_value_pre","qb1_value_post","qb1_game_value","qbelo_prob1","qbelo1_post"]]
mahomesQbScore2 = Mahomes2[["date","qb2_value_pre","qb2_value_post","qb2_game_value","qbelo_prob2","qbelo2_post"]]
mahomesQbScore1.columns = ["date","qb_value_pre","qb_value_post","qb_game_value","qbelo_prob","qbelo_post"]
mahomesQbScore2.columns = ["date","qb_value_pre","qb_value_post","qb_game_value","qbelo_prob","qbelo_post"]
mahomesQbScore = pd.concat([mahomesQbScore1,mahomesQbScore2],sort=False).sort_values("date")
mahomesQbScore.head()<jupyter_output><empty_output><jupyter_text>Garoppolo<jupyter_code>Garoppolo = df.loc[(df["qb1"] == "<NAME>") | (df["qb2"] == "<NAME>")]
Garoppolo.head()
Garoppolo1 = df.loc[df["qb1"] == "<NAME>"]
Garoppolo2 = df.loc[df["qb2"] == "<NAME>"]
garoppoloQbScore1 = Garoppolo1[["date","qb1_value_pre","qb1_value_post","qb1_game_value","qbelo_prob1","qbelo1_post"]]
garoppoloQbScore2 = Garoppolo2[["date","qb2_value_pre","qb2_value_post","qb2_game_value","qbelo_prob2","qbelo2_post"]]
garoppoloQbScore1.columns = ["date","qb_value_pre","qb_value_post","qb_game_value","qbelo_prob","qbelo_post"]
garoppoloQbScore2.columns = ["date","qb_value_pre","qb_value_post","qb_game_value","qbelo_prob","qbelo_post"]
garoppoloQbScore = pd.concat([garoppoloQbScore1,garoppoloQbScore2],sort=False).sort_values("date")
garoppoloQbScore.head()<jupyter_output><empty_output><jupyter_text>ProcessWe now have mahomesQbScore and garoppoloQbScore<jupyter_code>mahomesQbScore.head()
plt.figure(figsize=(10,5))

ax = sns.lineplot(x="date", y="qb_game_value", data=mahomesQbScore)
#ax.set_xticklabels(ax.get_xticklabels(), rotation=45)
ax.set_xticklabels(mahomesQbScore["date"],rotation=90)


plt.figure(figsize=(10,5))
ax = sns.lineplot(x="date", y="qb_game_value", data=garoppoloQbScore)
#ax.set_xticklabels(ax.get_xticklabels(), rotation=45)
ax.set_xticklabels(garoppoloQbScore["date"],rotation=90)<jupyter_output><empty_output><jupyter_text>Now let's try combining them<jupyter_code>mahomesQbScore["player"] = "<NAME>"
garoppoloQbScore["player"] = "<NAME>"
qbScores = pd.concat([mahomesQbScore,garoppoloQbScore])
a = qbScores["date"][1] 
dt_obj = datetime.strptime(a, '%m/%d/%Y')
print(dt_obj.day)
def dateToGameWeek(date):
    month = date.month
    year = date.year
    day = date.day
    if month == 9 and day >= 5 and day <= 9:
        week = 1
    elif month == 9 and day >=12 and day <= 15:
        week = 2
    elif month == 9 and day >=19 and day <= 23:
        week = 3
    elif month == 9 and day >= 26 and day <= 30:
        week = 4
    elif month == 10 and day >= 2 and day <= 7:
        week = 5
    elif month == 10 and day >= 10 and day <= 14:
        week = 6
    elif month == 10 and day >= 17 and day <= 21:
        week = 7
    elif month == 10 and day >=24 and day <= 28:
        week = 8
    elif (month == 10 or month == 11) and (day == 31 or day == 3 or day == 4):
        week = 9
    elif month == 11 and day >= 7 and day <= 11:
        week = 10
    elif month == 11 and day >= 14 and day <= 18:
        week = 11
    elif month == 11 and day >= 21 and day <= 25:
        week = 12
    elif (month == 11 or month == 12) and (day == 28 or day == 1 or day == 2):
        week = 13
    elif month == 12 and day >= 5 and day <= 9:
        week = 14
    elif month == 12 and day >= 12 and day <= 15:
        week = 15
    elif month == 12 and day >= 21 and day <= 23:
        week = 16
    elif month == 12 and day == 29:
        week = 17
    elif month == 1 and day >= 4 and day <= 5:
        week = 18
    elif month == 1 and day >= 11 and day <= 12:
        week = 19
    elif month == 1 and day == 19:
        week = 20
    elif month == 2 and day == 2:
        week = 21
    else:
        week = "Error"
        print(date)
    return(week)
gameWeeks = []
for index, row in qbScores.iterrows():
    date = datetime.strptime(row["date"], '%m/%d/%Y')
    week = dateToGameWeek(date)
    gameWeeks.append(week)
    
    
qbScores["week"] = gameWeeks
qbScores = qbScores.sort_values("week")
qbScores.to_csv("qbScores.csv")
plt.figure(figsize=(10,5))
ax = sns.lineplot(x="week", y="qb_game_value", data=qbScores,hue = "player",style="player",markers=True)
#ax.set_xticklabels(ax.get_xticklabels(), rotation=45)
#ax.set_xticklabels(ax.get_xticklabels())
ax.set_title("ELO of Superbowl Quarterbacks Over the Season and Post-Season")
sns.lmplot(x="week", y="qb_game_value", hue="player", data=qbScores);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16940928270042194, 'fraction_numerical': 0.04451476793248945, 'mean_word_length': 4.5, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '65972', 'license': 'MIT', 'n_tokens_mistral': 2041, 'n_tokens_neox': 1849, 'n_words': 368, 'path': '2020superBowl/Untitled.ipynb', 'repo_name': 'HenryCWong/MoDataNotebooks', 'size': '4830'}