数值单位与计量规则
原能力
统一金额、数量、价格、比例及时间单位,按具名规则计量和舍入。(合同附件 R7 22.3)
首选项目
Pandera(MIT)。 Pandera
匹配范围
字段量纲检查与数值计量基元。
源码
Pandera · def validate(
pandera/api/pandas/container.py · 127–140 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def validate(
self,
check_obj: pd.DataFrame,
head: int | None = None,
tail: int | None = None,
sample: int | None = None,
random_state: int | None = None,
lazy: bool = False,
inplace: bool = False,
) -> pd.DataFrame:
"""Validate a DataFrame based on the schema specification.
:param pd.DataFrame check_obj: the dataframe to be validated.
:param head: validate the first n rows. Rows overlapping with `tail` or
实现与验收要点
原单位、币种、舍入、误差或溢出规则。