如果在使用 NumPy 中的 isfinite
函数时遇到了 "ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule 'safe'" 错误消息,这说明该函数不支持输入的数据类型,无法安全地将其转换为任何支持的类型。
解决方法:
检查输入的数据类型,并确保它们是 NumPy 支持的数据类型。
将输入的数据强制转换为支持的数据类型,例如使