image_output_1.png
import pandas as pd

data = pd.read_csv('../input/kaggle-survey-2020/kaggle_survey_2020_responses.csv')

data.shape

def datainfo(df):
    return pd.DataFrame([(col, df[col].nunique(), df[col].isna().sum(), df[col].dtype, df[col].unique()[:5]) for col in df.columns], columns=['name', 'nunique', 'missing', 'dtype', 'values :5'])

question = data.iloc[0, :]
data = data.iloc[1:, :]

pd.options.display.float_format = lambda x: '{:.0f}'.format(x) if int(x) == x else '{:,.2f}'.format(x)
data.groupby('Q3')['Q5'].value_counts().unstack().style.background_gradient(cmap='Blues')

data.loc[data['Q7_Part_1'].notnull() & data['Q7_Part_2'] & data['Q7_Part_3']].loc[:, ['Q7_Part_1', 'Q7_Part_2', 'Q7_Part_3']].value_counts()