canonicalization
canonicalization
¶
Stable typed identities for dataframe scalar values.
Functions:
| Name | Description |
|---|---|
is_missing_scalar |
Return whether |
readable_value |
Return the human-readable form of |
canonicalize_scalar |
Return a deterministic type-tagged identity for a non-missing scalar. |
is_missing_scalar(value)
¶
Return whether value is one scalar missing-value marker.
Source code in src/nemo_safe_synthesizer/pii_replacer/replacement/canonicalization.py
readable_value(value)
¶
Return the human-readable form of value used as a data-to-sampler value mapping key.
Planning and replacement both derive mapping keys through this function, so a key written in a plan
matches at replacement time. It equals normalized_value except that timedeltas use pandas'
string form instead of nanoseconds.
Source code in src/nemo_safe_synthesizer/pii_replacer/replacement/canonicalization.py
canonicalize_scalar(value)
¶
Return a deterministic type-tagged identity for a non-missing scalar.
Python, NumPy, and pandas representations of the same scalar normalize to the same identity. Strings remain byte-for-byte unchanged.
Raises:
| Type | Description |
|---|---|
ParameterError
|
If |