text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
sns.despine(left=True, right=True, bottom=True, top=True)
sns.set_style('white')

df = pd.read_csv('../input/kaggle-survey-2020/kaggle_survey_2020_responses.csv', engine='python', error_bad_lines=False)

colunas = ['Q1', 'Q2', 'Q4', 'Q5', 'Q6', 'Q8', 'Q11', 'Q13', 'Q15', 'Q20', 'Q21', 'Q24', 'Q25', 'Q30', 'Q32', 'Q38']
for i in colunas:
  fig, ax = plt.subplots(1,1, figsize=(15, 6))
  sns.countplot(y = df[i][1:],data=df.iloc[1:], order=df[i][1:].value_counts().index, palette='Blues_r')
  fig.text(0.1, 0.95, f'{df[i][0].split("(")[0]}', fontsize=16, fontweight='bold', fontfamily='serif')
  plt.xlabel(' ', fontsize=20)
  plt.ylabel('')
  plt.yticks(fontsize=13)
  plt.box(False)

colunas = ['Q7', 'Q10', 'Q12', 'Q14', 'Q16', 'Q17', 'Q18', 'Q19', 'Q23', 'Q26', 'Q27', 'Q28', 'Q29', 'Q31', 'Q33', 'Q34', 'Q35', 'Q36', 'Q37']
for j in colunas:
    df_q = df[[i for i in df.columns if j in i]]
    df_q_count = pd.Series(dtype='int')
    for i in df_q:
        df_q_count[df_q[i].value_counts().index[0]] = df_q[i].count()
    ax, fig = plt.subplots(1, 1, figsize=(15, 6))
    sns.barplot(y=df_q_count.sort_values()[::-1].index, x=df_q_count.sort_values()[::-1], palette='Blues_r')
    fig.text(0, -1, f"\n\n{df[i][0].split('(')[0]}\n", fontsize=20, fontweight='bold', fontfamily='monospace')
    plt.box(False)
    plt.xlabel('')
    plt.ylabel('')
    plt.yticks(fontsize=20)