条形图不显示任何东西

我在原子中编写了代码。我用数据制作了数据透视表,然后尝试用破折号制作条形图,但破折号未生成条形图。尽管当我尝试使用plotly.express从数据透视图生成图表时,它还是在制作图表(使用juypter)。

import pandas as pd

import plotly.offline as pyo

import plotly.graph_objs as go

import numpy as np

ebt= pd.read_csv(r'C:\Users\SyedAbbas\Documents\Nielsen ebt\EBT 2018.csv')

ebt1=pd.pivot_table(ebt,values='responseid',index='agea',aggfunc=lambda x:x.sum()/ebt['responseid'].sum(),margins=False,dropna=True)

ebt1=(ebt1*100).round(0)

print(ebt1)

data=[go.Bar(x=ebt1.index,y=ebt1.values)]

layout=go.Layout(title='age')

fig=go.Figure(data=data,layout=layout)

pyo.plot(fig)

enter image description here

showOoOoOoOo 回答:条形图不显示任何东西

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3134911.html

大家都在问