各位python大神,走过路过不要错过!
Error:cannot copy sequence with size 11 to array axis with dimension 15
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
# Read the pharma sector data
file = r'C:/file/a.xlsx'
data = pd.read_excel(file)
df = pd.Series([data],dtype='float')
print(df)
ax = sns.heatmap(
df,
vmin=-1, vmax=1, center=0,
cmap=sns.diverging_palette(220, 20, n=256),
standard_scale =0
)
print("OK!")
plt.show()
输出结果如下:我的excel表确实是11*15
ValueError: cannot copy sequence with size 11 to array axis with dimension 15
不知道为什么如果表的数据是11*11或者15*15这样正方矩阵,是不出错误的。但是,如果不是正方,就会error。作为一个python小白,百思不得其解!
各位大神,求!跪求!