【发布时间】:2020-09-29 21:48:33
【问题描述】:
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''
我正在绘制运动(足球)热图。在努力打开带有事件数据的csv文件后,我将编码更改为utf-16并成功打开了文件。现在,当我在最后绘制热图时,我得到了这个错误。我没有将红色球场作为显示玩家热图的输出,而是得到一个空的白色球场。
【问题讨论】:
-
您可能应该先显示您在代码中尝试的内容以及发生错误的位置
-
我解决了这个问题,谢谢。我不得不将 x'y 坐标的数据类型从字符串更改为浮点数。
标签: python error-handling typeerror analytics visualization