Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hkailee/1a3905a9acb9b622c6b5f22cca9a6cc0 to your computer and use it in GitHub Desktop.
Save hkailee/1a3905a9acb9b622c6b5f22cca9a6cc0 to your computer and use it in GitHub Desktop.
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