我正在尝试用我自己的数据集从以下内容重新创建以下热图:
https://seaborn.pydata.org/examples/heatmap_annotation.html
我得到以下错误:
计算数据=绘图_数据。数据[~np.伊斯南(绘图)_数据。数据)] TypeError:输入类型不支持ufunc'isnan',a
任何帮助解决问题的人都将不胜感激。数据似乎加载和透视正确,但可能不是正确的数据类型。你知道吗
谢谢你
蒂姆
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
sns.set()
# Load the example flights dataset and convert to long-form
flights_long = pd.read_csv("Data.csv")
flights = flights_long.pivot("month", "year", "passengers")
# Draw a heatmap with the numeric values in each cell
f, ax = plt.subplots(figsize=(9, 6))
sns.heatmap(flights, annot=True, fmt="d", linewidths=.5, ax=ax)
plt.show()
目前没有回答
相关问题 更多 >
编程相关推荐