import pointblank as pb
spec = pb.MissingSpec(reasons={-99: "not_asked", -98: "refused", -97: "refused"})
spec.sentinel_values()[-99, -98, -97]
Get all sentinel values that encode missingness.
Usage
The sentinel values are the keys of reasons, in the order they were given. This is the list to use when you need the codes themselves, for example to filter them out of a table before computing a summary statistic.
listreasons (the actual values in the data that represent missingness). Note that this does not include None even when null_is_missing=True; use is_missing() to test individual values.
import pointblank as pb
spec = pb.MissingSpec(reasons={-99: "not_asked", -98: "refused", -97: "refused"})
spec.sentinel_values()[-99, -98, -97]
All three codes are listed, including the two that share the "refused" reason. Nulls aren’t listed even though the spec treats them as missing (null_is_missing=True is the default), because they aren’t values that appear in reasons.