python热力图填充失败

python爬虫网页,已完整爬出表格格式数据,在绘制热力图的时候只有数据轴没有办法进行热力数据的填充。
以下是爬虫过程和绘图过程


import pandas as pd


url = "http://www.kaom.net/sgy_jj_bu8.php"
res = pd.read_html(url)[1]
print(res)
res.to_excel('data.xlsx')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import itertools
import seaborn as sns

plt.rcParams['font.sans-serif'] = ['Arial Unicode MS']
df = pd.read_excel('data.xlsx')
newIndex = ['魚', '鐸', '陽', '之', '職', '蒸',  '支', '錫', '耕', '侯', '屋', '東',  '幽', '覺', '冬', '宵', '藥', '歌', '月', '元',  '微', '物', '文', '脂', '質', '真', '葉', '談', '緝', '侵', ]
df = df.reindex(newIndex)
df = df.reindex(columns=newIndex)  # 按王力三十韵部排序
pt = df.corr()
sns.set(font="simhei")
plt.figure(figsize=(15, 15))
sns.heatmap(data=pt, vmin=0, vmax=1633, annot=True, fmt='d', cmap="RdBu_r")  # 绘制热力图
plt.show()


以下是跑出来的错误热力图

img

img



import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import itertools
import seaborn as sns
 
import pandas as pd
 
 
url = "http://www.kaom.net/sgy_jj_bu8.php"
res = pd.read_html(url)[1]
res.to_excel('data.xlsx',index=False)
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS']
df = pd.read_excel('data.xlsx')
newIndex = ['魚', '鐸', '陽', '之', '職', '蒸',  '支', '錫', '耕', '侯', '屋', '東',  '幽', '覺', '冬', '宵', '藥', '歌', '月', '元',  '微', '物', '文', '脂', '質', '真', '葉', '談', '緝', '侵', ]
# df = df.reindex(newIndex)
df = df.reindex(columns=newIndex)  # 按王力三十韵部排序
pt = df.corr()
sns.set(font="simhei")
# plt.figure(figsize=(15, 15))
sns.heatmap(data=df, cmap='coolwarm',fmt='g' ,annot=True)  # 绘制热力图
plt.show()
 


df = df.reindex(newIndex)
df = df.reindex(columns=newIndex)
你这取出来都是NaN,你断点上去看下