pandas-use-of-dot-is-null (PD003)
源自 pandas-vet linter。
作用
检查 Pandas 对象上 .isnull 的用法。
为什么这不好?
在 Pandas API 中,.isna 和 .isnull 是等效的。为了保持一致性,建议使用 .isna 代替 .isnull。
作为名称,.isna 更准确地反映了方法的行为,因为这些方法除了检查 None 值之外,还会检查 NaN 和 NaT 值。
示例
建议改为
源自 pandas-vet linter。
检查 Pandas 对象上 .isnull 的用法。
在 Pandas API 中,.isna 和 .isnull 是等效的。为了保持一致性,建议使用 .isna 代替 .isnull。
作为名称,.isna 更准确地反映了方法的行为,因为这些方法除了检查 None 值之外,还会检查 NaN 和 NaT 值。
建议改为