I would collapse those three line
```
valid_score = np.logical_and(denominator != 0.0, numerator != 0.0)
```