Open dbr96 opened 6 years ago
Because python (or anyone in the world as far as I know) cannot divide by 0, we have to protect against this by saying if a team does not shoot any free throws then the team scoring possession cannot be calculated -- does this seem right? it doesn't to me, but according to the formula thats what it is saying
No. If someone does not shoot free throws that doesn't mean they didn't score. Essentially, if TmFTA is 0, then only (TmFTM/TmFTA) should be 0. You can still equate the rest of the problem. it just becomes TmFGM +(1-(1-(0))^2)00.4 which becomes just TmFGM. I know this is strange and WAY unlikely but doesn't mean it is impossible.
https://github.com/kmb266/cs5150-basketball-project/blob/37a68d206d91ba7208e61c851fe2e65c8e60493b/app/advanced_stat.py#L378
Does the set-up of 'return TmFTA = 0' affect this since there are 2 TmFTA in the formula? WhatI mean is that if TmFTA is 0, TmFGM can still be a number. Hope that make sense.