Update app.py
Browse files
app.py
CHANGED
|
@@ -583,13 +583,13 @@ def server(input, output, session):
|
|
| 583 |
import polars as pl
|
| 584 |
|
| 585 |
# Compute total pitches for each pitcher
|
| 586 |
-
df_pitcher_totals = df_spring_stuff.group_by(["pitcher_id"]).agg(
|
| 587 |
pl.col("start_speed").count().alias("pitcher_total")
|
| 588 |
)
|
| 589 |
|
| 590 |
df_pitcher_totals_hands = (
|
| 591 |
df_spring_stuff
|
| 592 |
-
.group_by(["pitcher_id", "batter_hand"])
|
| 593 |
.agg(pl.col("start_speed").count().alias("pitcher_total"))
|
| 594 |
.pivot(
|
| 595 |
values="pitcher_total",
|
|
@@ -602,7 +602,7 @@ def server(input, output, session):
|
|
| 602 |
)
|
| 603 |
|
| 604 |
|
| 605 |
-
df_spring_group = df_spring_stuff.group_by(['pitcher_id', 'pitcher_name', 'pitch_type']).agg([
|
| 606 |
pl.col('start_speed').count().alias('count'),
|
| 607 |
pl.col('start_speed').mean().alias('start_speed'),
|
| 608 |
pl.col('start_speed').max().alias('max_start_speed'),
|
|
|
|
| 583 |
import polars as pl
|
| 584 |
|
| 585 |
# Compute total pitches for each pitcher
|
| 586 |
+
df_pitcher_totals = df_spring_stuff.group_by(["pitcher_id",'game_date']).agg(
|
| 587 |
pl.col("start_speed").count().alias("pitcher_total")
|
| 588 |
)
|
| 589 |
|
| 590 |
df_pitcher_totals_hands = (
|
| 591 |
df_spring_stuff
|
| 592 |
+
.group_by(["pitcher_id", "batter_hand",'game_date'])
|
| 593 |
.agg(pl.col("start_speed").count().alias("pitcher_total"))
|
| 594 |
.pivot(
|
| 595 |
values="pitcher_total",
|
|
|
|
| 602 |
)
|
| 603 |
|
| 604 |
|
| 605 |
+
df_spring_group = df_spring_stuff.group_by(['pitcher_id', 'pitcher_name', 'pitch_type','game_date']).agg([
|
| 606 |
pl.col('start_speed').count().alias('count'),
|
| 607 |
pl.col('start_speed').mean().alias('start_speed'),
|
| 608 |
pl.col('start_speed').max().alias('max_start_speed'),
|