Chocolate datasets

Report a typo

You have decided to count how many chocolates your friends eat per month. Your brother Andy did the same thing for his friends. Now you have these two datasets:

my_friends = [10, 7, 11, 15, 11, 3, 1, 5, 6, 7, 9, 10]
andys_friends = [12, 3, 2, 5, 4, 10, 9, 6, 4, 3, 2, 2]

You have plotted these data in several ways, but unfortunately, the codes and images got mixed up. Match these 4 plots to their codes:

A.

A side-by-side histogram with 5 bins

B.

A side-by-side histogram with 4 bins

C.

A stacked histogram with 5 bins

D.

A side-by-side histogram with 5 bins and set range

Match the items from left and right columns
A
B
C
D
plt.hist([my_friends, andys_friends], bins=5, stacked=True, edgecolor='white')
plt.hist([my_friends, andys_friends], bins=[4, 6, 8, 10])
plt.hist([my_friends, andys_friends], bins=5)
plt.hist([my_friends, andys_friends], bins=5, range=(5, 10))
___

Create a free account to access the full topic