尝试使用 seaborn 绘制线图时出现以下错误。
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''
Run Code Online (Sandbox Code Playgroud)
重现错误的最小示例:
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
dataset = {
"x": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
"y": [1.0, 2.3, 4.5, 1.2, 3.4, 5.3, 1.1, 2.4, 3.6, 1.1, 3.3, 5.3],
"id": ["a", "a", "a", "b", "b", "b", "a", …Run Code Online (Sandbox Code Playgroud)