An analytics system collects user scores but some entries are missing. Fill each missing score with the mean of all non-null scores, rounded to 2 decimal places, and return the full DataFrame in the original row order.
df
| column | type |
|---|---|
| user_id | int |
| score | float (nullable) |
| user_id | score |
|---|---|
| 1 | 80.0 |
| 2 | 90.0 |
| 3 | NaN |
| 4 | 70.0 |
| user_id | score |
|---|---|
| 1 | 80.0 |
| 2 | 90.0 |
| 3 | 80.0 |
| 4 | 70.0 |
The mean of the three non-null scores (80 + 90 + 70) / 3 = 80.0, so the NaN in row 3 is replaced with 80.0.
df shape = (3, 2), columns: user_id, score