首页 > 解决方案 > 尝试划分两个屏蔽数组时出现类型错误

问题描述

我正在尝试划分两个蒙面数组但接收

TypeError: 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''

代码是

denominator = np.ma.dot(a_masked, b_masked)
numerator = np.abs(a_masked).sum(axis=1)
denominator[0]/numerator

你们中有人知道为什么会发生这种情况以及如何解决吗?

先感谢您 :)

标签: pythondivisionmasked-array

解决方案


推荐阅读