scitype#
- scitype(obj, candidate_scitypes=['Series', 'Panel', 'Hierarchical', 'Alignment', 'Table', 'Proba'], exclude_mtypes=['numpyflat', 'alignment_loc', 'pd-long', 'pd-wide'])[源代码]#
推断对象的科学类型 (scitype)。
关于 :glossary:`mtype` 和 :glossary:`scitype` 的解释,请参见术语表。
- 参数:
- obj要推断类型的对象 - 任何类型,应符合某个 mtype 规范
如果提供了 as_scitype,则此对象需要是属于 scitype 的 mtype
- candidate_scitypes: 字符串或字符串列表,从中选择的 scitype
有效的 scitype 字符串在 datatypes.SCITYPE_REGISTER 中
- exclude_mtypes字符串列表,默认为 AMBIGUOUS_MTYPES
在推断 mtype 时忽略哪些 mtype,默认为歧义 mtype,有效的 mtype 字符串在 datatypes.MTYPE_REGISTER 中
- 返回:
- 字符串 - 推断出的 “obj” 的科学类型,一个有效的 scitype 字符串
如果 obj 为 None,则返回 None
包含解释的 scitype 字符串在 datatypes.SCITYPE_REGISTER 中
- 引发:
- TypeError 如果无法识别类型,或识别出多个类型,则引发 TypeError