Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -938,15 +938,15 @@ def server(input, output, session):
|
|
| 938 |
filtered_df
|
| 939 |
.with_columns([
|
| 940 |
# Total pitches for each pitcher
|
| 941 |
-
pl.col("
|
| 942 |
# Proportion of pitches
|
| 943 |
-
(pl.col("
|
| 944 |
])
|
| 945 |
).filter(pl.col("pitch_proportion") > 0.05)
|
| 946 |
|
| 947 |
df_stuff = pl.concat([filtered_all_df.with_columns(
|
| 948 |
-
[pl.col("
|
| 949 |
-
(pl.col("
|
| 950 |
), result_df])
|
| 951 |
|
| 952 |
|
|
|
|
| 938 |
filtered_df
|
| 939 |
.with_columns([
|
| 940 |
# Total pitches for each pitcher
|
| 941 |
+
pl.col("count").sum().over("pitcher_id").alias("total_pitches"),
|
| 942 |
# Proportion of pitches
|
| 943 |
+
(pl.col("count") / pl.col("count").sum().over("pitcher_id")).alias("pitch_proportion"),
|
| 944 |
])
|
| 945 |
).filter(pl.col("pitch_proportion") > 0.05)
|
| 946 |
|
| 947 |
df_stuff = pl.concat([filtered_all_df.with_columns(
|
| 948 |
+
[pl.col("count").sum().over("pitcher_id").alias("total_pitches"),
|
| 949 |
+
(pl.col("count") / pl.col("count").sum().over("pitcher_id")).alias("pitch_proportion")]
|
| 950 |
), result_df])
|
| 951 |
|
| 952 |
|