Generation

generate functionWed, 22 Feb 2023

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 plot_bar(df, question, title_text, xlabel, ylabel, orientation='h'): question = df[question].value_counts() label = question.index counts = question.values fig = px.bar(x=counts, y=label, orientation='h') fig.update_layout(title_text=title_text) fig.show() df = pd.read_csv('https://raw.githubusercontent.com/GODKarma/Data-Analytics-2020/master/Data/survey_results_public.csv', index_col='Respondent') plot_bar(df, 'LanguageWorkedWith', 'С какими языками программирования вы работали?', 'Количество', 'Языки')

Questions about programming?Chat with your personal AI assistant