Python sns线图显示不必要的输出
试图从我的数据集中打印到cols 已成功绘制值,但它显示除打印ie(文本[]…)之外的额外输出 代码如下:Python sns线图显示不必要的输出,python,pandas,seaborn,Python,Pandas,Seaborn,试图从我的数据集中打印到cols 已成功绘制值,但它显示除打印ie(文本[]…)之外的额外输出 代码如下: dates = vac_plot['date'].apply(lambda x:np.array(x)) total = vac_plot['total_vaccinations'].apply(lambda x:np.array(x)) details = vac_plot[['date' , 'total_vaccinations']] here = sns.lineplot( x
dates = vac_plot['date'].apply(lambda x:np.array(x))
total = vac_plot['total_vaccinations'].apply(lambda x:np.array(x))
details = vac_plot[['date' , 'total_vaccinations']]
here = sns.lineplot( x = dates , y= total, data = 'details')
ax.set_title('Total Vaccinations')
plt.xticks(
rotation=45,
horizontalalignment='right',
fontweight='light',
fontsize='8'
)
以下是输出:
默认情况下,Jupyter notebook将打印单元格块中最后一条语句的字符串表示形式。在本例中,这是
plt.xticks()
函数的返回
只要把
afterplt.xticks
以抑制打印输出
# other code...
plt.xticks(
rotation=45,
horizontalalignment='right',
fontweight='light',
fontsize='8'
);
或者您可以添加plt.show()
:
在后一种解决方案中,plt.show()
返回None
,Jupyter不会打印出来
# other code...
plt.xticks(
rotation=45,
horizontalalignment='right',
fontweight='light',
fontsize='8'
);