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()

def bar_graphs(df1, df2): plt.figure(figsize=(15,7)) plt.subplot(2,2,1) sns.barplot(df1['city'].value_counts().index, df1['city'].value_counts().values) plt.xticks(rotation=40) plt.title('City') plt.subplot(2,2,2) sns.barplot(df2['hotel'].value_counts().index, df2['hotel'].value_counts().values) plt.xticks(rotation=40) plt.title('Hotel') plt.subplot(2,2,3) sns.barplot(df2['date'].value_counts().index, df2['date'].value_counts().values) plt.xticks(rotation=40) plt.title('Date') plt

Questions about programming?Chat with your personal AI assistant