Python可视化交互式饼图

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.

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容