Created
December 25, 2020 03:47
-
-
Save hkailee/1a3905a9acb9b622c6b5f22cca9a6cc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.express as px | |
# grouping statistics | |
ds = df_all.groupby(['leiden', 'GICS Sector', 'GICS Sub-Industry'])['log_return_1mth'].count().reset_index() | |
ds.columns = ['leiden', 'GICS Sector', 'GICS Sub-Industry', 'count'] | |
# plotting sunburst | |
fig = px.sunburst( | |
ds, | |
path=[ | |
'leiden', 'GICS Sector', 'GICS Sub-Industry' | |
], | |
values='count', | |
title='Sunburst chart', | |
width=900, | |
height=900 | |
) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment