Change the code below so that the columns have values on the x-axis question6 = 'What is the most preferred working environment for you.' question6 = df[question6].value_counts() label = question6.index counts = question6.values fig = px.bar(x=counts, y=label, orientation='h') fig.update_layout(title_text='Какая рабочая среда для вас наиболее предпочтительна?') fig.show()
def y_axis(question6): question6 = df[question6].value_counts() label = question6.index counts = question6.values return counts def x_axis(question6): question6 = df[question6].value_counts() label = question6.index counts = question6.values return label def plot(question6): fig = px.bar(x=y_axis(question6), y=x_axis(question6), orientation='h') fig.update_layout(title_text=question6) fig.show() plot('What is the most preferred working environment for you.')