Dư Huy
Dư Huy

Reputation: 65

Heatmap error :'NoneType' object is not callable when using with dataframe

I have this issue with heatmap from seaborn. I don't know how, but seaborn.heatmap() refuses to take in dataframe, it instead show the mentioned error. Seaborn, matplotlib and pandas is up-to-date and I'm using python 3.10 on Visual Studio. The code is just a sample code from seaborn.heatmap itself:

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()

Upvotes: 6

Views: 1304

Answers (1)

rudolfovic
rudolfovic

Reputation: 3276

Use Python 3.9 (or 3.8, 3.7, 3.6) as it seems like both pandas and plt are not quite ready to be used with Python 3.10:

enter image description here

Upvotes: 8

Related Questions