首页 > 解决方案 > Plt.Scatter at seaborn:错误:系列的真值不明确。使用 a.empty、a.bool()、a.item()、a.any() 或 a.all()

问题描述

当我尝试绘制我的图形时,我正在寻找解决我的问题的解决方案:“系列的真值是模棱两可的。使用 a.empty、a.bool()、a.item()、a.any( ) 或 a.all()。” 例如,如果我删除 data_t_quali['TOR'] 并只输入 'TOR'(正如 seaborn 网站上所说的那样),那么我会得到空图形。

g = sns.FacetGrid(data_t_quali1, col='Reussie',col_order=['Reprise en main reussie','Echec de la reprise en main'],hue='Age',hue_order=[20,30,40,50,60 ],size=6,aspect=1.2,palette=sns.light_palette('navy', 4)[1:])

g.map(plt.scatter,data_t_quali1['NombreFixation'],data_t_quali1['TOR'],alpha=0.9, edgecolor='white', linewidth=2, s=300)

fig = g.fig 
fig.subplots_adjust(top=0.79, wspace=0.3)
fig.suptitle('Time to take over control (TOR) in fonction of the fixation numbers 2 minutes before the regaining control of the vehicle', fontsize=20, fontweight='bold')
g.add_legend(title='Age du conducteur')

标签: pythondatabasedataframeplotseaborn

解决方案


推荐阅读