请帮助我 为什么当我使用hue属性时,直方图未显示在图中?
代码:
from matplotlib import pyplot as plt
import pandas as pd
import seaborn as sb
my_array =[
['Galaxy S8', 'Android', 64, 4, 149.0 ,'Samsung' ,5.8],
['Lumia950' ,'windows' ,32, 3 ,150.0 ,'Microsoft', 5.2],
['Xpreia L1', 'Android', 16, 2, 180.0,'Sony' ,5.5],
['iphone 7', 'ios', 128 ,2, 138.0 ,'Apple' ,4.7],
['U Ultra', 'Android', 64, 4 ,170.0, 'HTC', 5.7],
['Galaxy S5' ,'Android', 16 ,2, 145.0 ,'Samsung' ,5.1],
['iphone 5s', 'ios', 32, 1, 112.0 ,'Apple' ,4.0],
['Moto G5' ,'Android' ,16, 3 ,144.5 ,'Motorola', 5.0],
['Pixel', 'Android' ,128 ,4 ,143.0 ,'Google' ,5.0]
]
smart_phones = pd.DataFrame(my_array , index = [0,1,2,3,4,5,6,7,8] ,
columns=['Name', 'OS', 'Capacity' ,'Ram', 'Weight', 'Company', 'inch'])
sb.pairplot(smart_phones , hue="Name" , palette="hls" ,plot_kws={'s':80})
plt.show();
错误:
C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\_methods.py:140:
RuntimeWarning: Degrees of freedom <= 0 for slice
keepdims=keepdims)
C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\_methods.py:132:
RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
谢谢您的回复