import pandas as pd
import plotly.express as px
data = pd.read_excel(r'D:\workbench\tensorflow\datavision\org.xlsx')
data.head()
#line_A代表人员规模 line_B代表产值
fig = px.sunburst(data,path=["centre","department","team"],values="line_A",color="line_B",
color_continuous_scale = 'Rdbu')
fig.show()
运行,生成可交互式饼图,可以层层递进以便更好的展示效果。
运行过程提示
C:\Users\RL-068\anaconda3\lib\site-packages\plotly\express\_core.py:1637: FutureWarning:
The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
C:\Users\RL-068\anaconda3\lib\site-packages\plotly\express\_core.py:1637: FutureWarning:
The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
C:\Users\RL-068\anaconda3\lib\site-packages\plotly\express\_core.py:1637: FutureWarning:
The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
网友评论