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 sns factorplot plot with x scale = 'date', y scale = 'difference', col = 'hotel'. You should get 6 graphs (one for each 'hotel')

def plot_difference_by_hotel(df): sns.factorplot( x='date', y='difference', col='hotel', data=df, kind='bar') plot_difference_by_hotel(hotels_rev)

Questions about programming?Chat with your personal AI assistant