LTHTR-DST / hdruk_avoidable_admissions

HDRUK Data Science Collaboration on Avoidable Admissions in the NHS.
https://lthtr-dst.github.io/hdruk_avoidable_admissions/
MIT License
6 stars 5 forks source link

Handling NaN townsend values #18

Closed MattStammers closed 1 year ago

MattStammers commented 1 year ago

We are currently losing 330 patients for whom Townsend cannot be calculated. How have you handled this?

vvcb commented 1 year ago

townsend_score_decile.fillna(0) is a workaround. nan is treated as float by Pandas. Modifying the schema to accept float instead of int dtypes to accomodate nan will make values like 3.5 valid as well.

This is documented in the example pipeline.

MattStammers commented 1 year ago

This one can be closed