Generation

generate functionSat, 28 Jan 2023

There is a Pandas dataframe: hotels_rev = df1[['date', 'hotel', 'revenue', 'av_revenue', 'difference', 'in_percent']].sort_values(by=['hotel', 'date']) Construct a bar graph with 'hotel' values in the x axis and change values in the 'date' column and 'av_revenue' values in the y axis

hotels_rev = df1[['date', 'hotel', 'revenue', 'av_revenue', 'difference', 'in_percent']].sort_values(by=['hotel', 'date']) plt.bar(hotels_rev['date'], hotels_rev['av_revenue'], color='red') plt.xlabel('Date') plt.ylabel('Average revenues') plt.title('Average revenues per hotel') plt.xticks(rotation=90) plt.show()

Questions about programming?Chat with your personal AI assistant