Untitled

 avatar
unknown
plain_text
2 years ago
469 B
3
Indexable
result = data.groupby(['district', 'category']).size().reset_index(name='count')
result = result.sort_values(['district', 'count'], ascending=[True, False])

# Строим график
fig = px.bar(result, x='district', y='count', color='category')
fig.update_layout(title='Топ-15 имен заведений', xaxis_title='Названия заведений', yaxis_title='Количество заведений')
fig.update_xaxes(tickangle=45)
fig.show()
Editor is loading...