Update stuff_model/calculate_arm_angles.py
Browse files
stuff_model/calculate_arm_angles.py
CHANGED
|
@@ -105,8 +105,11 @@ def calculate_arm_angles(df: pl.DataFrame,pitcher_id:int) -> pl.DataFrame:
|
|
| 105 |
|
| 106 |
|
| 107 |
df_filter = df_filter.with_columns(
|
| 108 |
-
df_filter["arm_angle"]
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
print([x for x in df_filter["arm_angle"]])
|
| 112 |
|
|
|
|
| 105 |
|
| 106 |
|
| 107 |
df_filter = df_filter.with_columns(
|
| 108 |
+
df_filter["arm_angle"]
|
| 109 |
+
.fill_nan(None) # Convert NaN to null
|
| 110 |
+
.fill_null(df_filter["arm_angle"].mean()) # Fill nulls with mean
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
|
| 114 |
print([x for x in df_filter["arm_angle"]])
|
| 115 |
|