Skip to content

Instantly share code, notes, and snippets.

@srang992
Created April 12, 2023 16:11
Show Gist options
  • Save srang992/f063d2fa049bff60da0192c5c8eefc88 to your computer and use it in GitHub Desktop.
Save srang992/f063d2fa049bff60da0192c5c8eefc88 to your computer and use it in GitHub Desktop.
# filtering those companies where Kokoa Kamili is manufactured
company_loc_list = list(choco_data[choco_data['bar_name'].isin(['Kokoa Kamili'])]['company_loc'])
company_loc_dict = {i:company_loc_list.count(i) for i in company_loc_list}
# plotting the data
fig = px.pie(values=list(company_loc_dict.values()),
names=list(company_loc_dict.keys()),
title='Most Common Location where Kokoa Kamili is Manufactured',
color_discrete_sequence=px.colors.sequential.Aggrnyl)
# customizing the plot
fig.update_traces(textposition='inside', textinfo='percent+label')
fig.update_layout(uniformtext_minsize=12)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment