【问题标题】:TypeError: ufunc 'isfinite' not supported for the input typesTypeError:输入类型不支持 ufunc 'isfinite'
【发布时间】: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


【解决方案1】:

我解决了这个问题,谢谢。我不得不将 x'y 坐标的数据类型从字符串更改为浮点数。

【讨论】:

    猜你喜欢
    • 2020-02-16
    • 1970-01-01
    • 2019-11-04
    • 2018-01-08
    • 2020-07-28
    • 2022-12-17
    • 1970-01-01
    • 2020-07-21
    • 2023-03-30
    相关资源
    最近更新 更多