Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -320,6 +320,13 @@ def server(input, output, session):
|
|
| 320 |
)))).with_columns(
|
| 321 |
pl.col('pitch_type').count().over('pitch_type').alias('pitch_count')
|
| 322 |
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
return df
|
| 324 |
|
| 325 |
|
|
|
|
| 320 |
)))).with_columns(
|
| 321 |
pl.col('pitch_type').count().over('pitch_type').alias('pitch_count')
|
| 322 |
))
|
| 323 |
+
|
| 324 |
+
df = df.with_columns(
|
| 325 |
+
prop_percent=(pl.col('is_pitch') / pl.col('is_pitch').sum()).over("pitch_type"),
|
| 326 |
+
prop=pl.col('is_pitch').sum().over("pitch_type")
|
| 327 |
+
)
|
| 328 |
+
|
| 329 |
+
|
| 330 |
return df
|
| 331 |
|
| 332 |
|