这是一个可运行的代码段,在我的计算机上生成错误。我遇到了这个错误(ValueError:零大小的数组,以最小化没有身份的缩小操作)。
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from pandas import DataFrame
data=pd.read_csv(r"C:\Users\yavuz\Desktop\Pokemon.csv", sep='\t',
engine='python')
f,ax=plt.subplots(figsize=(18,18))
sns.heatmap(data.corr())
**Error**
Traceback (most recent call last):
File "C:/Users/yavuz/.PyCharmEdu2018.2/config/scratches/scratch_4.py", line 14, in <module>
sns.heatmap(data.corr())
File "C:\Users\yavuz\PycharmProjects\deneme\venv\lib\site-packages\seaborn\matrix.py", line 517, in heatmap
yticklabels, mask)
File "C:\Users\yavuz\PycharmProjects\deneme\venv\lib\site-packages\seaborn\matrix.py", line 167, in __init__
cmap, center, robust)
File "C:\Users\yavuz\PycharmProjects\deneme\venv\lib\site-packages\seaborn\matrix.py", line 206, in _determine_cmap_params
vmin = np.percentile(calc_data, 2) if robust else calc_data.min()
File "C:\Users\yavuz\PycharmProjects\deneme\venv\lib\site-packages\numpy\core\_methods.py", line 32, in _amin
return umr_minimum(a, axis, None, out, keepdims, initial)
ValueError: zero-size array to reduction operation minimum which has no identity
Process finished with exit code 1
ValueError:零尺寸数组到最小化操作的最小值,没有身份,请帮助我