Generation

generate functionSat, 28 Jan 2023

Construct 4 seaborn bar graphs from these data: 1) df1['city'].value_counts() 2) df2['hotel'].value_counts() 3) df2['date'].value_counts() 4) df2['rating'].value_counts()

import seaborn as sns import matplotlib.pyplot as plt def bar_graph(data): plt.figure(figsize=(18, 6)) sns.barplot(data.index, data.values, alpha=0.8) plt.title(str(data.name)) plt.ylabel('Count', fontsize=12) plt.xlabel('Name', fontsize=12) plt.show()

Questions about programming?Chat with your personal AI assistant