#绘制因子正交后的相关性热力图
fig=plt.figure(figsize=(26,18))
#计算对称正交之后的相关系数矩阵
relations= get_relations(factors5.iloc[:,:-2])
sns.heatmap(relations,annot=True,linewidths=0.05,
linecolor='white',annot_kws={'size':8,'weight':'bold'})
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
< ipython-input-21-23bbb650a415> in < module>
4 relations= get_relations(factors5.iloc[:,:-2])
5 sns.heatmap(relations,annot=True,linewidths=0.05,
----> 6 linecolor='white',annot_kws={'size':8,'weight':'bold'})
/opt/conda/lib/python3.6/site-packages/seaborn/matrix.py in heatmap(data, vmin, vmax, cmap, center, robust, annot, fmt, annot_kws, linewidths, linecolor, cbar, cbar_kws, cbar_ax, square, xticklabels, yticklabels, mask, ax, **kwargs)
515 plotter = _HeatMapper(data, vmin, vmax, cmap, center, robust, annot, fmt,
516 annot_kws, cbar, cbar_kws, xticklabels,
--> 517 yticklabels, mask)
518
519 # Add the pcolormesh kwargs here
/opt/conda/lib/python3.6/site-packages/seaborn/matrix.py in __init__(self, data, vmin, vmax, cmap, center, robust, annot, fmt, annot_kws, cbar, cbar_kws, xticklabels, yticklabels, mask)
165 # Determine good default values for the colormapping
166 self._determine_cmap_params(plot_data, vmin, vmax,
--> 167 cmap, center, robust)
168
169 # Sort out the annotations
/opt/conda/lib/python3.6/site-packages/seaborn/matrix.py in _determine_cmap_params(self, plot_data, vmin, vmax, cmap, center, robust)
204 calc_data = plot_data.data[~np.isnan(plot_data.data)]
205 if vmin is None:
--> 206 vmin = np.percentile(calc_data, 2) if robust else calc_data.min()
207 if vmax is None:
208 vmax = np.percentile(calc_data, 98) if robust else calc_data.max()
/opt/conda/lib/python3.6/site-packages/numpy/core/_methods.py in _amin(a, axis, out, keepdims)
27
28 def _amin(a, axis=None, out=None, keepdims=False):
---> 29 return umr_minimum(a, axis, None, out, keepdims)
30
31 def _sum(a, axis=None, dtype=None, out=None, keepdims=False):
ValueError: zero-size array to reduction operation minimum which has no identity
< Figure size 1872x1296 with 0 Axes>
```
2021-03-18