Skip to content

Instantly share code, notes, and snippets.

@a-agmon
Created September 6, 2020 07:08
Show Gist options
  • Save a-agmon/a610c9493f728173d4e755462f381878 to your computer and use it in GitHub Desktop.
Save a-agmon/a610c9493f728173d4e755462f381878 to your computer and use it in GitHub Desktop.
# Show a pie chart of the groups
summs = df_avg.cluster.value_counts()
cats = np.zeros(len(summs))
for i, x in enumerate(summs): cats[i] = x
labels = ['Evening / Night','Normal Day', 'Late Night / Early Morning']
sizes = summs.astype(int)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, labels=labels, autopct='%1.1f%%',shadow=True, startangle=90)
ax1.axis('equal')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment