口径核验
原能力
检查样本结构、统计版本和季节性是否改变,标记异常能否由这些因素解释。(细化版 p.4–5)
首选项目
Pandera(MIT)。 Pandera
匹配范围
DataFrameSchema 检查字段和采样,STL 辅助季节对照。
源码
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
实现与验收要点
样本结构、统计修订和基线可比性判断。