xxxxxxxxxx
#import packages
import matplotlib.pyplot as plt
import pandas as pd
# create the plot
restaurant_groups['group_size'].hist(bins = [2, 3, 4, 5, 6])
# Display the plot
plt.show()
xxxxxxxxxx
import matplotlib.pyplot as plt
# Data for the histogram
data = [1, 1, 1, 2, 2, 3, 4, 4, 5, 6, 7, 7, 7, 8, 8]
# Creating the histogram
plt.hist(data, bins=5, color='blue', edgecolor='black')
# Adding labels and title
plt.xlabel('Values')
plt.ylabel('Frequency')
plt.title('Histogram')
plt.grid(True)
# Displaying the histogram
plt.show()