-HeatMap错误:与DataFrame使用时,“非电视”对象无法调用

问题描述 投票:0回答:2
我在Seaborn的Heatmap上遇到了这个问题。我不知道如何,但是seaborn.heatmap()拒绝使用数据帧,而是显示上述错误。 Seaborn,Matplotlib和Pandas是最新的,我在Visual Studio上使用Python 3.10。该代码只是seaborn.heatmap本身的示例代码:

import pandas as pd import seaborn as sns import matplotlib.pyplot as plt flights = sns.load_dataset("flights") flights = flights.pivot("month", "year", "passengers") ax=sns.heatmap(flights) plt.show()
    
python seaborn heatmap
2个回答
8
投票
使用Python 3.9(OR 3.8、3.7、3.6),因为似乎

pandasplt都不准备与Python 3.10:一起使用。

enter image description here


0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.