Skip to content

Commit

Permalink
This branch should be a secret
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatXliner committed Mar 3, 2024
1 parent f3f95e1 commit 643e524
Show file tree
Hide file tree
Showing 2 changed files with 300 additions and 247 deletions.
17 changes: 16 additions & 1 deletion apps/angry/angry/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

def main():
df = pd.read_csv(Path(__file__).parent.parent / "input.csv")
df = df[df["Team #"].astype(str).str.isdigit()]
# Data normalization
df["Can score trap?"] = (
df["Can score trap?"].replace("No", False).replace("Yes", True)
)
df["Outcome"] = (
df["Outcome"].replace("Win", 1).replace("Loss", -1).replace("Tie", 0)
)

df["# Speaker Notes"] = (
df["# Speaker Notes"].replace("DC", float("nan")).astype(float)
)
df["# Amp Notes"] = df["# Amp Notes"].replace("DC", float("nan")).astype(float)
df["Timestamp"] = pd.to_datetime(df["Timestamp"], infer_datetime_format=True)
df["Match ID (Quals-1, Elims-12 / Playoffs-12)"] = df[
"Match ID (Quals-1, Elims-12 / Playoffs-12)"
Expand All @@ -19,11 +25,20 @@ def main():
df["Auto Mobility"] = (
df["Mobility"].replace("Success", 1).replace("Failure", -1).replace("DC", -1)
)
team_summary = df.groupby("Team #")["Outcome"].sum().rename("Total win - loss")
team_notes = df.groupby("Team #")[["# Speaker Notes", "# Amp Notes"]].sum()
team_counts = df["Team #"].value_counts()
team_notes_divided = team_notes.div(team_counts, axis=0)

team_notes_sorted = team_notes_divided.sort_values(
by=["# Speaker Notes", "# Amp Notes"], ascending=False
)
print(team_notes_sorted)
print(team_summary)
# print("....")
# print(df["Alliance", "Team #", "# Speaker Notes", "# Amp Notes"])
# df.loc[df['Year'] == '2019', 'Outcome'].sum()
print(df)
# print(df)


if __name__ == "__main__":
Expand Down
Loading

0 comments on commit 643e524

Please sign in to comment.