{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# 2021 Kaggle Data Science & Machine Learning Survey \n\n* Every response to every question from 2021, with occasional use of data from 2017, 2018, 2019, and 2020.\n   - **Results Filtered: Job Title = Student (only)**\n* Consider filtering the data to only include the respondents that you are most interested in (e.g. job title, industry, location, etc)\n* Click on the \"Copy & Edit\" button if you want to explore the data on your own!\n* Can you identify any insights about any of the subgroups within the Kaggle community?","metadata":{"id":"7ZOL2PZLHsww","papermill":{"duration":0.073228,"end_time":"2021-10-13T23:00:57.097907","exception":false,"start_time":"2021-10-13T23:00:57.024679","status":"completed"},"tags":[]}},{"cell_type":"markdown","source":"* *Step 1: Import Python libraries and load the data*","metadata":{"id":"NC3AzH_xHswx","papermill":{"duration":0.070407,"end_time":"2021-10-13T23:00:57.240659","exception":false,"start_time":"2021-10-13T23:00:57.170252","status":"completed"},"tags":[]}},{"cell_type":"code","source":"import os\nimport numpy as np \nimport pandas as pd \nimport seaborn as sns\nimport plotly.express as px\nfrom plotly.offline import init_notebook_mode\nimport plotly.graph_objects as go\ninit_notebook_mode(connected=True)\npd.set_option('display.max_columns', 5000)\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nif not os.path.exists('/kaggle/working/individual_charts/'):\n    os.mkdir('/kaggle/working/individual_charts/')\n\n# Load the data\n\ndef load_csv(base_dir,file_name):\n    \"\"\"Loads a CSV file into a Pandas DataFrame\"\"\"\n    file_path = os.path.join(base_dir,file_name)\n    df = pd.read_csv(file_path,low_memory=False,encoding='ISO-8859-1')\n    return df    \n\nbase_dir_2017 = '/kaggle/input/kaggle-survey-2017/'\nfile_name_2017 = 'multipleChoiceResponses.csv'\nsurvey_df_2017 = load_csv(base_dir_2017,file_name_2017)\nsurvey_df_2017 = survey_df_2017[survey_df_2017['CurrentJobTitleSelect']=='Student'] \nresponses_df_2017 = survey_df_2017[1:]\nsurvey_df_2017.to_csv('2017_kaggle_ds_and_ml_survey_responses_from_data_students_only.csv',index=False)\n\nbase_dir_2018 = '/kaggle/input/kaggle-survey-2018/'\nfile_name_2018 = 'multipleChoiceResponses.csv'\nsurvey_df_2018 = load_csv(base_dir_2018,file_name_2018)\nsurvey_df_2018 = survey_df_2018[survey_df_2018['Q6']=='Student'] \nresponses_df_2018 = survey_df_2018[1:]\nsurvey_df_2018.to_csv('2018_kaggle_ds_and_ml_survey_responses_from_data_students_only.csv',index=False)\n\nbase_dir_2019 = '/kaggle/input/kaggle-survey-2019/'\nfile_name_2019 = 'multiple_choice_responses.csv'\nsurvey_df_2019 = load_csv(base_dir_2019,file_name_2019)\nsurvey_df_2019 = survey_df_2019[survey_df_2019['Q5']=='Student'] \nresponses_df_2019 = survey_df_2019[1:]\nsurvey_df_2019.to_csv('2019_kaggle_ds_and_ml_survey_responses_from_students_only.csv',index=False)\n\nbase_dir_2020 = '/kaggle/input/kaggle-survey-2020'\nfile_name_2020 = 'kaggle_survey_2020_responses.csv'\nsurvey_df_2020 = load_csv(base_dir_2020,file_name_2020)\nsurvey_df_2020 = survey_df_2020[survey_df_2020['Q5']=='Student'] \nresponses_df_2020 = survey_df_2020[1:]\nsurvey_df_2020.to_csv('2020_kaggle_ds_and_ml_survey_responses_from_data_students_only.csv',index=False)\n\nbase_dir_2021 = '../input/kaggle-survey-2021/'\nfile_name_2021 = 'kaggle_survey_2021_responses.csv'\nsurvey_df_2021 = load_csv(base_dir_2021,file_name_2021)\nsurvey_df_2021 = survey_df_2021[survey_df_2021['Q5']=='Student'] \nresponses_df_2021 = survey_df_2021[1:]\nsurvey_df_2021.to_csv('2021_kaggle_ds_and_ml_survey_responses_from_data_students_only.csv',index=False)\n\nprint('Total Number of Responses 2017: ',responses_df_2017.shape[0])\nprint('Total Number of Responses 2018: ',responses_df_2018.shape[0])\nprint('Total Number of Responses 2019: ',responses_df_2019.shape[0])\nprint('Total Number of Responses 2020: ',responses_df_2020.shape[0])\nprint('Total Number of Responses 2021: ',responses_df_2021.shape[0])","metadata":{"_kg_hide-input":true,"papermill":{"duration":10.51727,"end_time":"2021-10-13T23:01:07.829388","exception":false,"start_time":"2021-10-13T23:00:57.312118","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:17:54.702713Z","iopub.execute_input":"2022-07-07T16:17:54.703154Z","iopub.status.idle":"2022-07-07T16:18:01.568819Z","shell.execute_reply.started":"2022-07-07T16:17:54.703121Z","shell.execute_reply":"2022-07-07T16:18:01.567956Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"*Step 2: Define helper functions, plotting functions, and helper dictionaries/lists*","metadata":{"id":"9s-IE7K6Hsw1","papermill":{"duration":0.069716,"end_time":"2021-10-13T23:01:07.970664","exception":false,"start_time":"2021-10-13T23:01:07.900948","status":"completed"},"tags":[]}},{"cell_type":"code","source":"def count_then_return_percent(dataframe,column_name):\n    '''\n    A helper function to return value counts as percentages.\n    '''\n    counts = dataframe[column_name].value_counts(dropna=False)\n    percentages = round(counts*100/(dataframe[column_name].count()),1)\n    return percentages\n\ndef count_then_return_percent_for_multiple_column_questions(dataframe,list_of_columns_for_a_single_question,dictionary_of_counts_for_a_single_question):\n    '''\n    A helper function to convert counts to percentages.\n    '''\n    df = dataframe\n    subset = list_of_columns_for_a_single_question\n    df = df[subset]\n    df = df.dropna(how='all')\n    total_count = len(df) \n    dictionary = dictionary_of_counts_for_a_single_question\n    for i in dictionary:\n        dictionary[i] = round(float(dictionary[i]*100/total_count),1)\n    return dictionary \n\ndef create_dataframe_of_counts(dataframe,column,rename_index,rename_column,return_percentages=False):\n    '''\n    A helper function to create a dataframe of either counts \n    or percentages, for a single multiple choice question.\n    '''\n    df = dataframe[column].value_counts().reset_index() \n    if return_percentages==True:\n        df[column] = (df[column]*100)/(df[column].sum())\n    df = pd.DataFrame(df) \n    df = df.rename({'index':rename_index, column:rename_column}, axis='columns')\n    return df\n\ndef sort_dictionary_by_percent(dataframe,list_of_columns_for_a_single_question,dictionary_of_counts_for_a_single_question): \n    ''' \n    A helper function that can be used to sort a dictionary.   \n    It is an adaptation of a similar function\n    from https://www.kaggle.com/sonmou/what-topics-from-where-to-learn-data-science.\n    '''\n    dictionary = count_then_return_percent_for_multiple_column_questions(dataframe,\n                                                                list_of_columns_for_a_single_question,\n                                                                dictionary_of_counts_for_a_single_question)\n    dictionary = {v:k    for(k,v) in dictionary.items()}\n    list_tuples = sorted(dictionary.items(), reverse=False) \n    dictionary = {v:k for (k,v) in list_tuples}   \n    return dictionary\n\ndef plotly_choropleth_map(df, column, title, max_value):\n    '''\n    This function creates a choropleth map.\n    '''\n    fig = px.choropleth(df, \n                    locations = 'country',  \n                    color = column,\n                    locationmode = 'country names', \n                    color_continuous_scale = 'viridis',\n                    title = title,\n                    range_color = [0, max_value])\n    fig.update(layout=dict(title=dict(x=0.5)))\n    fig.show()\n\ndef plotly_bar_chart(response_counts,title,y_axis_title,orientation):\n    '''\n    This function creates a bar chart.\n    '''\n    response_counts_series = pd.Series(response_counts)\n    pd.DataFrame(response_counts_series).to_csv('/kaggle/working/individual_charts/chart_'+title+'.csv',index=True)\n    fig = px.bar(response_counts_series,\n             labels={\"index\": '',\"value\": y_axis_title},\n             text=response_counts_series.values,\n             orientation=orientation,)\n    fig.update_layout(showlegend=False,\n                      title={'text': title+' in 2021',\n                             'y':0.95,\n                             'x':0.5,})\n    fig.show()\n    \ndef plotly_bar_chart_with_x_axis_limit(response_counts,title,y_axis_title,orientation,limit_for_axis):\n    '''\n    A slightly modified version of plotly_bar_chart().\n    '''\n    response_counts_series = pd.Series(response_counts)\n    pd.DataFrame(response_counts_series).to_csv('/kaggle/working/individual_charts/chart_'+title+'.csv',index=True)\n    fig = px.bar(response_counts_series,\n             labels={\"index\": '',\"value\": y_axis_title},\n             text=response_counts_series.values,\n             orientation=orientation,)\n    fig.update_xaxes(range=[0, limit_for_axis])\n    fig.update_layout(showlegend=False,\n                      title={'text': title+' in 2021',\n                             'y':0.95,\n                             'x':0.5,})\n    fig.show()","metadata":{"_kg_hide-input":true,"id":"2NbRRdjsHsw2","papermill":{"duration":0.096747,"end_time":"2021-10-13T23:01:08.13768","exception":false,"start_time":"2021-10-13T23:01:08.040933","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:01.570797Z","iopub.execute_input":"2022-07-07T16:18:01.571447Z","iopub.status.idle":"2022-07-07T16:18:01.594609Z","shell.execute_reply.started":"2022-07-07T16:18:01.571401Z","shell.execute_reply":"2022-07-07T16:18:01.593660Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Questions where respondents can select more than one answer choice have been split into multiple columns.\n# These dictionaries contain value counts for every answer choice for every multiple-column question.\nq7_dictionary_of_counts_2018 = {\n    'Python' : (responses_df_2018['Q16_Part_1'].count()),\n    'R': (responses_df_2018['Q16_Part_2'].count()),\n    'SQL' : (responses_df_2018['Q16_Part_3'].count()),\n    'C/C++' : (responses_df_2018['Q16_Part_8'].count()),\n    'Visual Basic / BVA' : (responses_df_2018['Q16_Part_7'].count()),\n    'Java' : (responses_df_2018['Q16_Part_5'].count()),\n    'Javascript' : (responses_df_2018['Q16_Part_6'].count()),\n    'C#/.NET' : (responses_df_2018['Q16_Part_13'].count()),\n    'PHP' : (responses_df_2018['Q16_Part_14'].count()),\n    'Go' : (responses_df_2018['Q16_Part_12'].count()),\n    'Scala' : (responses_df_2018['Q16_Part_10'].count()),\n    'Bash' : (responses_df_2018['Q16_Part_4'].count()),\n    'MATLAB' : (responses_df_2018['Q16_Part_9'].count()),\n    'None' : (responses_df_2018['Q16_Part_17'].count()),\n    'Other' : (responses_df_2018['Q16_Part_18'].count())\n}\n\nq9_dictionary_of_counts_2018 = {\n    'JupyterLab' : (responses_df_2018['Q13_Part_1'].count()),\n    'RStudio': (responses_df_2018['Q13_Part_2'].count()),\n    'Atom' : (responses_df_2018['Q13_Part_6'].count()),\n    'Visual Studio Code (VSCode)' : (responses_df_2018['Q13_Part_4'].count()),\n    'PyCharm' : (responses_df_2018['Q13_Part_3'].count()),\n    'Spyder' : (responses_df_2018['Q13_Part_13'].count()),\n    'Notepad++' : (responses_df_2018['Q13_Part_9'].count()),\n    'Sublime Text' : (responses_df_2018['Q13_Part_10'].count()),\n    'Vim, Emacs, or similar' : (responses_df_2018['Q13_Part_11'].count()),\n    'Visual Studio' : (responses_df_2018['Q13_Part_8'].count()),\n    'MATLAB' : (responses_df_2018['Q13_Part_7'].count()),\n    'None' : (responses_df_2018['Q13_Part_14'].count()),\n    'Other' : (responses_df_2018['Q13_Part_15'].count())\n}\n\n\nq10_dictionary_of_counts_2018 = {\n    'Kaggle Notebooks' : (responses_df_2018['Q14_Part_1'].count()),\n    'Colab Notebooks': (responses_df_2018['Q14_Part_2'].count()),\n    'Azure Notebooks' : (responses_df_2018['Q14_Part_3'].count()),\n    'Paperspace / Gradient' : (responses_df_2018['Q14_Part_6'].count()),\n    'Binder / JupyterHub' : (responses_df_2018['Q14_Part_9'].count()),\n    'Domino Datalab' : (responses_df_2018['Q14_Part_4'].count()),\n    'Crestle' : (responses_df_2018['Q14_Part_8'].count()),\n    'Google Cloud Notebook Products' : (responses_df_2018['Q14_Part_5'].count()),\n    'FloydHub Notebooks' : (responses_df_2018['Q14_Part_7'].count()),\n    'None' : (responses_df_2018['Q14_Part_10'].count()),\n    'Other' : (responses_df_2018['Q14_Part_11'].count())\n}\n\n\n\nq14_dictionary_of_counts_2018 = {\n    'Matplotlib' : (responses_df_2018['Q21_Part_2'].count()),\n    'Seaborn': (responses_df_2018['Q21_Part_8'].count()),\n    'Plotly / Plotly Express' : (responses_df_2018['Q21_Part_6'].count()),\n    'Ggplot / ggplot2' : (responses_df_2018['Q21_Part_1'].count()),\n    'Shiny' : (responses_df_2018['Q21_Part_4'].count()),\n    'D3.js' : (responses_df_2018['Q21_Part_5'].count()),\n    'Altair' : (responses_df_2018['Q21_Part_3'].count()),\n    'Bokeh' : (responses_df_2018['Q21_Part_7'].count()),\n    'Geoplotlib' : (responses_df_2018['Q21_Part_9'].count()),\n    'Leaflet / Folium' : (responses_df_2018['Q21_Part_10'].count()),\n    'None' : (responses_df_2018['Q21_Part_12'].count()),\n    'Other' : (responses_df_2018['Q21_Part_13'].count())\n}\n\n\nq16_dictionary_of_counts_2018 = {\n    'Scikit-learn' : (responses_df_2018['Q19_Part_1'].count()),\n    'TensorFlow': (responses_df_2018['Q19_Part_2'].count()),\n    'Keras' : (responses_df_2018['Q19_Part_3'].count()),\n    'PyTorch' : (responses_df_2018['Q19_Part_4'].count()),\n    'Fast.ai' : (responses_df_2018['Q19_Part_7'].count()),\n    'RandomForest' : (responses_df_2018['Q19_Part_13'].count()),\n    'Spark MLib' : (responses_df_2018['Q19_Part_5'].count()),\n    'MXNet' : (responses_df_2018['Q28_Part_8'].count()),\n    'Xgboost' : (responses_df_2018['Q19_Part_10'].count()),\n    'LightGBM' : (responses_df_2018['Q19_Part_14'].count()),\n    'CatBoost' : (responses_df_2018['Q19_Part_15'].count()),\n    'Prophet' : (responses_df_2018['Q19_Part_12'].count()),\n    'H20-3' : (responses_df_2018['Q19_Part_6'].count()),\n    'Caret' : (responses_df_2018['Q19_Part_9'].count()),\n    'None' : (responses_df_2018['Q19_Part_18'].count()),\n    'Other' : (responses_df_2018['Q19_Part_19'].count())\n}\n\n\nq26a_dictionary_of_counts_2018 = {\n    'Amazon Web Services (AWS)' : (responses_df_2018['Q15_Part_2'].count()),\n    'Microsoft Azure': (responses_df_2018['Q15_Part_3'].count()),\n    'Google Cloud Platform (GCP)' : (responses_df_2018['Q15_Part_1'].count()),\n    'IBM Cloud / Red Hat' : (responses_df_2018['Q15_Part_4'].count()),\n    'Alibaba Cloud' : (responses_df_2018['Q15_Part_5'].count()),\n    'None' : (responses_df_2018['Q15_Part_6'].count()),\n    'Other' : (responses_df_2018['Q15_Part_7'].count())\n}\n\n\n\nq29a_dictionary_of_counts_2018 = {\n    'MySQL' : (responses_df_2018['Q29_Part_10'].count()),\n    'PostgreSQL': (responses_df_2018['Q29_Part_11'].count()),\n    'SQLite' : (responses_df_2018['Q29_Part_12'].count()),\n    'Oracle Database' : (responses_df_2018['Q29_Part_13'].count()),\n    'IBM Db2' : (responses_df_2018['Q29_Part_26'].count()),\n    'Microsoft SQL Server' : (responses_df_2018['Q29_Part_9'].count()),\n    'Microsoft Access' : (responses_df_2018['Q29_Part_15'].count()),\n    'Microsoft Azure SQL Database' : (responses_df_2018['Q29_Part_21'].count()),\n    'Amazon Redshift' : (responses_df_2018['Q30_Part_9'].count()),\n    'AWS Relational Database Service' : (responses_df_2018['Q29_Part_1'].count()),\n    'AWS DynamoDB' : (responses_df_2018['Q29_Part_5'].count()),\n    'Google Cloud BigQuery' : (responses_df_2018['Q30_Part_10'].count()),\n    'Google Cloud SQL' : (responses_df_2018['Q29_Part_3'].count()),\n    'None' : (responses_df_2018['Q29_Part_27'].count()),\n    'Other' : (responses_df_2018['Q29_Part_28'].count())\n}\n\n\n# Questions where respondents can select more than one answer choice have been split into multiple columns.\n# These dictionaries contain value counts for every answer choice for every multiple-column question.\n\n\nq7_dictionary_of_counts_2019 = {\n    'Python' : (responses_df_2019['Q18_Part_1'].count()),\n    'R': (responses_df_2019['Q18_Part_2'].count()),\n    'SQL' : (responses_df_2019['Q18_Part_3'].count()),\n    'C' : (responses_df_2019['Q18_Part_4'].count()),\n    'C++' : (responses_df_2019['Q18_Part_5'].count()),\n    'Java' : (responses_df_2019['Q18_Part_6'].count()),\n    'Javascript' : (responses_df_2019['Q18_Part_7'].count()),\n    'TypeScript' : (responses_df_2019['Q18_Part_8'].count()),\n    'Bash' : (responses_df_2019['Q18_Part_9'].count()),\n    'MATLAB' : (responses_df_2019['Q18_Part_10'].count()),\n    'None' : (responses_df_2019['Q18_Part_11'].count()),\n    'Other' : (responses_df_2019['Q18_Part_12'].count())\n}\n\n\nq9_dictionary_of_counts_2019 = {\n    'JupyterLab' : (responses_df_2019['Q16_Part_1'].count()),\n    'RStudio': (responses_df_2019['Q16_Part_2'].count()),\n    'Atom' : (responses_df_2019['Q16_Part_4'].count()),\n    'Visual Studio / Visual Studio Code (VSCode)' : (responses_df_2019['Q16_Part_6'].count()),\n    'PyCharm' : (responses_df_2019['Q16_Part_3'].count()),\n    'Spyder' : (responses_df_2019['Q16_Part_7'].count()),\n    'Notepad++' : (responses_df_2019['Q16_Part_9'].count()),\n    'Sublime Text' : (responses_df_2019['Q16_Part_10'].count()),\n    'Vim, Emacs, or similar' : (responses_df_2019['Q16_Part_8'].count()),\n    'MATLAB' : (responses_df_2019['Q16_Part_5'].count()),\n    'None' : (responses_df_2019['Q16_Part_11'].count()),\n    'Other' : (responses_df_2019['Q16_Part_12'].count())\n}\n\nq10_dictionary_of_counts_2019 = {\n    'Kaggle Notebooks' : (responses_df_2019['Q17_Part_1'].count()),\n    'Colab Notebooks': (responses_df_2019['Q17_Part_2'].count()),\n    'Azure Notebooks' : (responses_df_2019['Q17_Part_3'].count()),\n    'Paperspace / Gradient' : (responses_df_2019['Q17_Part_5'].count()),\n    'Binder / JupyterHub' : (responses_df_2019['Q17_Part_7'].count()),\n    'Code Ocean' : (responses_df_2019['Q17_Part_9'].count()),\n    'IBM Watson Studio' : (responses_df_2019['Q17_Part_8'].count()),\n    'Amazon Notebook Products' : (responses_df_2019['Q17_Part_10'].count()),\n    'Google Cloud Notebook Products' : (responses_df_2019['Q17_Part_4'].count()),\n    'FloydHub Notebooks' : (responses_df_2019['Q17_Part_6'].count()),\n    'None' : (responses_df_2019['Q17_Part_11'].count()),\n    'Other' : (responses_df_2019['Q17_Part_12'].count())\n}\n\n\nq12_dictionary_of_counts_2019 = {\n    'CPUs' : (responses_df_2019['Q21_Part_1'].count()),\n    'GPUs' : (responses_df_2019['Q21_Part_2'].count()),\n    'TPUs': (responses_df_2019['Q21_Part_3'].count()),\n    'None' : (responses_df_2019['Q21_Part_4'].count()),\n    'Other' : (responses_df_2019['Q21_Part_5'].count())\n}\n\n\nq14_dictionary_of_counts_2019 = {\n    'Matplotlib' : (responses_df_2019['Q20_Part_2'].count()),\n    'Seaborn': (responses_df_2019['Q20_Part_8'].count()),\n    'Plotly / Plotly Express' : (responses_df_2019['Q20_Part_6'].count()),\n    'Ggplot / ggplot2' : (responses_df_2019['Q20_Part_1'].count()),\n    'Shiny' : (responses_df_2019['Q20_Part_4'].count()),\n    'D3.js' : (responses_df_2019['Q20_Part_5'].count()),\n    'Altair' : (responses_df_2019['Q20_Part_3'].count()),\n    'Bokeh' : (responses_df_2019['Q20_Part_7'].count()),\n    'Geoplotlib' : (responses_df_2019['Q20_Part_9'].count()),\n    'Leaflet / Folium' : (responses_df_2019['Q20_Part_10'].count()),\n    'None' : (responses_df_2019['Q20_Part_11'].count()),\n    'Other' : (responses_df_2019['Q20_Part_12'].count())\n}\n\nq16_dictionary_of_counts_2019 = {\n    'Scikit-learn' : (responses_df_2019['Q28_Part_1'].count()),\n    'TensorFlow': (responses_df_2019['Q28_Part_2'].count()),\n    'Keras' : (responses_df_2019['Q28_Part_3'].count()),\n    'PyTorch' : (responses_df_2019['Q28_Part_6'].count()),\n    'Fast.ai' : (responses_df_2019['Q28_Part_10'].count()),\n    'RandomForest' : (responses_df_2019['Q28_Part_4'].count()),\n    'Spark MLib' : (responses_df_2019['Q28_Part_9'].count()),\n    'Xgboost' : (responses_df_2019['Q28_Part_5'].count()),\n    'LightGBM' : (responses_df_2019['Q28_Part_8'].count()),\n    'Caret' : (responses_df_2019['Q28_Part_7'].count()),\n    'None' : (responses_df_2019['Q28_Part_11'].count()),\n    'Other' : (responses_df_2019['Q28_Part_12'].count())\n}\n\n\nq17_dictionary_of_counts_2019 = {\n    'Linear or Logistic Regression' : (responses_df_2019['Q24_Part_1'].count()),\n    'Decision Trees or Random Forests': (responses_df_2019['Q24_Part_2'].count()),\n    'Gradient Boosting Machines (xgboost, lightgbm, etc)' : (responses_df_2019['Q24_Part_3'].count()),\n    'Bayesian Approaches' : (responses_df_2019['Q24_Part_4'].count()),\n    'Evolutionary Approaches' : (responses_df_2019['Q24_Part_5'].count()),\n    'Dense Neural Networks (MLPs, etc)' : (responses_df_2019['Q24_Part_6'].count()),\n    'Convolutional Neural Networks' : (responses_df_2019['Q24_Part_7'].count()),\n    'Generative Adversarial Networks' : (responses_df_2019['Q24_Part_8'].count()),\n    'Recurrent Neural Networks' : (responses_df_2019['Q24_Part_9'].count()),\n    'Transformer Networks (BERT, gpt-3, etc)' : (responses_df_2019['Q24_Part_10'].count()),\n    'None' : (responses_df_2019['Q24_Part_11'].count()),\n    'Other' : (responses_df_2019['Q24_Part_12'].count())\n}\n\n\nq18_dictionary_of_counts_2019 = {\n    'General purpose image/video tools (PIL, cv2, skimage, etc)' : (responses_df_2019['Q26_Part_1'].count()),\n    'Image segmentation methods (U-Net, Mask R-CNN, etc)': (responses_df_2019['Q26_Part_2'].count()),\n    'Object detection methods (YOLOv3, RetinaNet, etc)' : (responses_df_2019['Q26_Part_3'].count()),\n    'Image classification and other general purpose networks (VGG, Inception, ResNet, ResNeXt, NASNet, EfficientNet, etc)' : (responses_df_2019['Q26_Part_4'].count()),\n    'Generative Networks (GAN, VAE, etc)' : (responses_df_2019['Q26_Part_5'].count()),\n    'None' : (responses_df_2019['Q26_Part_6'].count()),\n    'Other' : (responses_df_2019['Q26_Part_7'].count())\n}\n\nq19_dictionary_of_counts_2019 = {\n    'Word embeddings/vectors (GLoVe, fastText, word2vec)' : (responses_df_2019['Q27_Part_1'].count()),\n    'Encoder-decoder models (seq2seq, vanilla transformers)': (responses_df_2019['Q27_Part_2'].count()),\n    'Contextualized embeddings (ELMo, CoVe)' : (responses_df_2019['Q27_Part_3'].count()),\n    'Transformer language models (GPT-3, BERT, XLnet, etc)' : (responses_df_2019['Q27_Part_4'].count()),\n    'None' : (responses_df_2019['Q27_Part_5'].count()),\n    'Other' : (responses_df_2019['Q27_Part_6'].count())\n}\n\nq26a_dictionary_of_counts_2019 = {\n    'Amazon Web Services (AWS)' : (responses_df_2019['Q29_Part_2'].count()),\n    'Microsoft Azure': (responses_df_2019['Q29_Part_3'].count()),\n    'Google Cloud Platform (GCP)' : (responses_df_2019['Q29_Part_1'].count()),\n    'IBM Cloud / Red Hat' : (responses_df_2019['Q29_Part_4'].count()),\n    'Oracle Cloud' : (responses_df_2019['Q29_Part_7'].count()),\n    'SAP Cloud' : (responses_df_2019['Q29_Part_8'].count()),\n    'Salesforce Cloud' : (responses_df_2019['Q29_Part_6'].count()),\n    'VMware Cloud' : (responses_df_2019['Q29_Part_9'].count()),\n    'Alibaba Cloud' : (responses_df_2019['Q29_Part_5'].count()),\n    'Red Hat Cloud' : (responses_df_2019['Q29_Part_10'].count()),\n    'None' : (responses_df_2019['Q29_Part_11'].count()),\n    'Other' : (responses_df_2019['Q29_Part_12'].count())\n}\n\nq29a_dictionary_of_counts_2019 = {\n    'MySQL' : (responses_df_2019['Q34_Part_1'].count()),\n    'PostgreSQL': (responses_df_2019['Q34_Part_2'].count()),\n    'SQLite' : (responses_df_2019['Q34_Part_3'].count()),\n    'Oracle Database' : (responses_df_2019['Q34_Part_5'].count()),\n    'Microsoft SQL Server' : (responses_df_2019['Q34_Part_4'].count()),\n    'Microsoft Access' : (responses_df_2019['Q34_Part_6'].count()),\n    'Microsoft Azure SQL Database' : (responses_df_2019['Q34_Part_9'].count()),\n    'Amazon Redshift' : (responses_df_2019['Q31_Part_2'].count()),\n    'AWS Relational Database Service' : (responses_df_2019['Q34_Part_7'].count()),\n    'AWS DynamoDB' : (responses_df_2019['Q34_Part_8'].count()),\n    'Google Cloud BigQuery' : (responses_df_2019['Q31_Part_1'].count()),\n    'Google Cloud SQL' : (responses_df_2019['Q34_Part_10'].count()),\n    'None' : (responses_df_2019['Q34_Part_11'].count()),\n    'Other' : (responses_df_2019['Q34_Part_12'].count())\n}\n\nq33a_dictionary_of_counts_2019 = {\n    'Google Cloud AutoML' : (responses_df_2019['Q33_Part_1'].count()),\n    'H20 Driverless AI': (responses_df_2019['Q33_Part_2'].count()),\n    'Databricks AutoML' : (responses_df_2019['Q33_Part_3'].count()),\n    'DataRobot AutoML' : (responses_df_2019['Q33_Part_4'].count()),\n    'Tpot' : (responses_df_2019['Q33_Part_5'].count()),\n    'Auto-Keras' : (responses_df_2019['Q33_Part_6'].count()),\n    'Auto-Sklearn' : (responses_df_2019['Q33_Part_7'].count()),\n    'Auto_ml' : (responses_df_2019['Q33_Part_8'].count()),\n    'Xcessiv' : (responses_df_2019['Q33_Part_9'].count()),\n    'MLbox' : (responses_df_2019['Q33_Part_10'].count()),\n    'No / None' : (responses_df_2019['Q33_Part_11'].count()),\n    'Other' : (responses_df_2019['Q33_Part_12'].count())\n}\n\n# Questions where respondents can select more than one answer choice have been split into multiple columns.\n# These dictionaries contain value counts for every answer choice for every multiple-column question.\n\nq7_dictionary_of_counts_2020 = {\n    'Python' : (responses_df_2020['Q7_Part_1'].count()),\n    'R': (responses_df_2020['Q7_Part_2'].count()),\n    'SQL' : (responses_df_2020['Q7_Part_3'].count()),\n    'C' : (responses_df_2020['Q7_Part_4'].count()),\n    'C++' : (responses_df_2020['Q7_Part_5'].count()),\n    'Java' : (responses_df_2020['Q7_Part_6'].count()),\n    'Javascript' : (responses_df_2020['Q7_Part_7'].count()),\n    'Julia' : (responses_df_2020['Q7_Part_8'].count()),\n    'Swift' : (responses_df_2020['Q7_Part_9'].count()),\n    'Bash' : (responses_df_2020['Q7_Part_10'].count()),\n    'MATLAB' : (responses_df_2020['Q7_Part_11'].count()),\n    'None' : (responses_df_2020['Q7_Part_12'].count()),\n    'Other' : (responses_df_2020['Q7_OTHER'].count())\n}\n\nq9_dictionary_of_counts_2020 = {\n    'JupyterLab' : (responses_df_2020['Q9_Part_1'].count()),\n    'RStudio': (responses_df_2020['Q9_Part_2'].count()),\n    'Visual Studio' : (responses_df_2020['Q9_Part_3'].count()),\n    'Visual Studio Code (VSCode)' : (responses_df_2020['Q9_Part_4'].count()),\n    'PyCharm' : (responses_df_2020['Q9_Part_5'].count()),\n    'Spyder' : (responses_df_2020['Q9_Part_6'].count()),\n    'Notepad++' : (responses_df_2020['Q9_Part_7'].count()),\n    'Sublime Text' : (responses_df_2020['Q9_Part_8'].count()),\n    'Vim, Emacs, or similar' : (responses_df_2020['Q9_Part_9'].count()),\n    'MATLAB' : (responses_df_2020['Q9_Part_10'].count()),\n    'None' : (responses_df_2020['Q9_Part_11'].count()),\n    'Other' : (responses_df_2020['Q9_OTHER'].count())\n}\n\nq10_dictionary_of_counts_2020 = {\n    'Kaggle Notebooks' : (responses_df_2020['Q10_Part_1'].count()),\n    'Colab Notebooks': (responses_df_2020['Q10_Part_2'].count()),\n    'Azure Notebooks' : (responses_df_2020['Q10_Part_3'].count()),\n    'Paperspace / Gradient' : (responses_df_2020['Q10_Part_4'].count()),\n    'Binder / JupyterHub' : (responses_df_2020['Q10_Part_5'].count()),\n    'Code Ocean' : (responses_df_2020['Q10_Part_6'].count()),\n    'IBM Watson Studio' : (responses_df_2020['Q10_Part_7'].count()),\n    'Amazon Sagemaker Studio' : (responses_df_2020['Q10_Part_8'].count()),\n    'Amazon EMR Notebooks' : (responses_df_2020['Q10_Part_9'].count()),\n    'Google Cloud AI Platform Notebooks' : (responses_df_2020['Q10_Part_10'].count()),\n    'Google Cloud Datalab Notebooks' : (responses_df_2020['Q10_Part_11'].count()),\n    'Databricks Collaborative Notebooks' : (responses_df_2020['Q10_Part_12'].count()),\n    'None' : (responses_df_2020['Q10_Part_13'].count()),\n    'Other' : (responses_df_2020['Q10_OTHER'].count())\n}\n\nq12_dictionary_of_counts_2020 = {\n    'GPUs' : (responses_df_2020['Q12_Part_1'].count()),\n    'TPUs': (responses_df_2020['Q12_Part_2'].count()),\n    'None' : (responses_df_2020['Q12_Part_3'].count()),\n    'Other' : (responses_df_2020['Q12_OTHER'].count())\n}\n\nq14_dictionary_of_counts_2020 = {\n    'Matplotlib' : (responses_df_2020['Q14_Part_1'].count()),\n    'Seaborn': (responses_df_2020['Q14_Part_2'].count()),\n    'Plotly / Plotly Express' : (responses_df_2020['Q14_Part_3'].count()),\n    'Ggplot / ggplot2' : (responses_df_2020['Q14_Part_4'].count()),\n    'Shiny' : (responses_df_2020['Q14_Part_5'].count()),\n    'D3.js' : (responses_df_2020['Q14_Part_6'].count()),\n    'Altair' : (responses_df_2020['Q14_Part_7'].count()),\n    'Bokeh' : (responses_df_2020['Q14_Part_8'].count()),\n    'Geoplotlib' : (responses_df_2020['Q14_Part_9'].count()),\n    'Leaflet / Folium' : (responses_df_2020['Q14_Part_10'].count()),\n    'None' : (responses_df_2020['Q14_Part_11'].count()),\n    'Other' : (responses_df_2020['Q14_OTHER'].count())\n}\n\nq16_dictionary_of_counts_2020 = {\n    'Scikit-learn' : (responses_df_2020['Q16_Part_1'].count()),\n    'TensorFlow': (responses_df_2020['Q16_Part_2'].count()),\n    'Keras' : (responses_df_2020['Q16_Part_3'].count()),\n    'PyTorch' : (responses_df_2020['Q16_Part_4'].count()),\n    'Fast.ai' : (responses_df_2020['Q16_Part_5'].count()),\n    'MXNet' : (responses_df_2020['Q16_Part_6'].count()),\n    'Xgboost' : (responses_df_2020['Q16_Part_7'].count()),\n    'LightGBM' : (responses_df_2020['Q16_Part_8'].count()),\n    'CatBoost' : (responses_df_2020['Q16_Part_9'].count()),\n    'Prophet' : (responses_df_2020['Q16_Part_10'].count()),\n    'H20-3' : (responses_df_2020['Q16_Part_11'].count()),\n    'Caret' : (responses_df_2020['Q16_Part_12'].count()),\n    'Tidymodels' : (responses_df_2020['Q16_Part_13'].count()),\n    'JAX' : (responses_df_2020['Q16_Part_14'].count()),\n    'None' : (responses_df_2020['Q16_Part_15'].count()),\n    'Other' : (responses_df_2020['Q16_OTHER'].count())\n}\n\nq17_dictionary_of_counts_2020 = {\n    'Linear or Logistic Regression' : (responses_df_2020['Q17_Part_1'].count()),\n    'Decision Trees or Random Forests': (responses_df_2020['Q17_Part_2'].count()),\n    'Gradient Boosting Machines (xgboost, lightgbm, etc)' : (responses_df_2020['Q17_Part_3'].count()),\n    'Bayesian Approaches' : (responses_df_2020['Q17_Part_4'].count()),\n    'Evolutionary Approaches' : (responses_df_2020['Q17_Part_5'].count()),\n    'Dense Neural Networks (MLPs, etc)' : (responses_df_2020['Q17_Part_6'].count()),\n    'Convolutional Neural Networks' : (responses_df_2020['Q17_Part_7'].count()),\n    'Generative Adversarial Networks' : (responses_df_2020['Q17_Part_8'].count()),\n    'Recurrent Neural Networks' : (responses_df_2020['Q17_Part_9'].count()),\n    'Transformer Networks (BERT, gpt-3, etc)' : (responses_df_2020['Q17_Part_10'].count()),\n    'None' : (responses_df_2020['Q17_Part_11'].count()),\n    'Other' : (responses_df_2020['Q17_OTHER'].count())\n}\n\n\nq18_dictionary_of_counts_2020 = {\n    'General purpose image/video tools (PIL, cv2, skimage, etc)' : (responses_df_2020['Q18_Part_1'].count()),\n    'Image segmentation methods (U-Net, Mask R-CNN, etc)': (responses_df_2020['Q18_Part_2'].count()),\n    'Object detection methods (YOLOv3, RetinaNet, etc)' : (responses_df_2020['Q18_Part_3'].count()),\n    'Image classification and other general purpose networks (VGG, Inception, ResNet, ResNeXt, NASNet, EfficientNet, etc)' : (responses_df_2020['Q18_Part_4'].count()),\n    'Generative Networks (GAN, VAE, etc)' : (responses_df_2020['Q18_Part_5'].count()),\n    'None' : (responses_df_2020['Q18_Part_6'].count()),\n    'Other' : (responses_df_2020['Q18_OTHER'].count())\n}\n\n\nq19_dictionary_of_counts_2020 = {\n    'Word embeddings/vectors (GLoVe, fastText, word2vec)' : (responses_df_2020['Q19_Part_1'].count()),\n    'Encoder-decoder models (seq2seq, vanilla transformers)': (responses_df_2020['Q19_Part_2'].count()),\n    'Contextualized embeddings (ELMo, CoVe)' : (responses_df_2020['Q19_Part_3'].count()),\n    'Transformer language models (GPT-3, BERT, XLnet, etc)' : (responses_df_2020['Q19_Part_4'].count()),\n    'None' : (responses_df_2020['Q19_Part_5'].count()),\n    'Other' : (responses_df_2020['Q19_OTHER'].count())\n}\n\n\nq23_dictionary_of_counts_2020 = {\n    'Analyze and understand data to influence product or business decisions' : (responses_df_2020['Q23_Part_1'].count()),\n    'Build and/or run the data infrastructure that my business uses for storing, analyzing, and operationalizing data': (responses_df_2020['Q23_Part_2'].count()),\n    'Build prototypes to explore applying machine learning to new areas' : (responses_df_2020['Q23_Part_3'].count()),\n    'Build and/or run a machine learning service that operationally improves my product or workflows' : (responses_df_2020['Q23_Part_4'].count()),\n    'Experimentation and iteration to improve existing ML models' : (responses_df_2020['Q23_Part_5'].count()),\n    'Do research that advances the state of the art of machine learning' : (responses_df_2020['Q23_Part_6'].count()),\n    'None of these activities are an important part of my role at work' : (responses_df_2020['Q23_Part_7'].count()),\n    'Other' : (responses_df_2020['Q23_OTHER'].count())\n}\n\n\nq26a_dictionary_of_counts_2020 = {\n    'Amazon Web Services (AWS)' : (responses_df_2020['Q26_A_Part_1'].count()),\n    'Microsoft Azure': (responses_df_2020['Q26_A_Part_2'].count()),\n    'Google Cloud Platform (GCP)' : (responses_df_2020['Q26_A_Part_3'].count()),\n    'IBM Cloud / Red Hat' : (responses_df_2020['Q26_A_Part_4'].count()),\n    'Oracle Cloud' : (responses_df_2020['Q26_A_Part_5'].count()),\n    'SAP Cloud' : (responses_df_2020['Q26_A_Part_6'].count()),\n    'Salesforce Cloud' : (responses_df_2020['Q26_A_Part_7'].count()),\n    'VMware Cloud' : (responses_df_2020['Q26_A_Part_8'].count()),\n    'Alibaba Cloud' : (responses_df_2020['Q26_A_Part_9'].count()),\n    'Tencent Cloud' : (responses_df_2020['Q26_A_Part_10'].count()),\n    'None' : (responses_df_2020['Q26_A_Part_11'].count()),\n    'Other' : (responses_df_2020['Q26_A_OTHER'].count())\n}\n\nq26b_dictionary_of_counts_2020 = {\n    'Amazon Web Services (AWS)' : (responses_df_2020['Q26_B_Part_1'].count()),\n    'Microsoft Azure': (responses_df_2020['Q26_B_Part_2'].count()),\n    'Google Cloud Platform (GCP)' : (responses_df_2020['Q26_B_Part_3'].count()),\n    'IBM Cloud / Red Hat' : (responses_df_2020['Q26_B_Part_4'].count()),\n    'Oracle Cloud' : (responses_df_2020['Q26_B_Part_5'].count()),\n    'SAP Cloud' : (responses_df_2020['Q26_B_Part_6'].count()),\n    'Salesforce Cloud' : (responses_df_2020['Q26_B_Part_7'].count()),\n    'VMware Cloud' : (responses_df_2020['Q26_B_Part_8'].count()),\n    'Alibaba Cloud' : (responses_df_2020['Q26_B_Part_9'].count()),\n    'Tencent Cloud' : (responses_df_2020['Q26_B_Part_10'].count()),\n    'None' : (responses_df_2020['Q26_B_Part_11'].count()),\n    'Other' : (responses_df_2020['Q26_B_OTHER'].count())\n}\n\nq27a_dictionary_of_counts_2020 = {\n    'Amazon EC2' : (responses_df_2020['Q27_A_Part_1'].count()),\n    'AWS Lambda': (responses_df_2020['Q27_A_Part_2'].count()),\n    'Amazon Elastic Container Service' : (responses_df_2020['Q27_A_Part_3'].count()),\n    'Azure Cloud Services' : (responses_df_2020['Q27_A_Part_4'].count()),\n    'Microsoft Azure Container Instances' : (responses_df_2020['Q27_A_Part_5'].count()),\n    'Azure Functions' : (responses_df_2020['Q27_A_Part_6'].count()),\n    'Google Cloud Compute Engine' : (responses_df_2020['Q27_A_Part_7'].count()),\n    'Google Cloud Functions' : (responses_df_2020['Q27_A_Part_8'].count()),\n    'Google Cloud Run' : (responses_df_2020['Q27_A_Part_9'].count()),\n    'Google Cloud App Engine' : (responses_df_2020['Q27_A_Part_10'].count()),\n    'No / None' : (responses_df_2020['Q27_A_Part_11'].count()),\n    'Other' : (responses_df_2020['Q27_A_OTHER'].count())\n}\n\nq27b_dictionary_of_counts_2020 = {\n    'Amazon EC2' : (responses_df_2020['Q27_B_Part_1'].count()),\n    'AWS Lambda': (responses_df_2020['Q27_B_Part_2'].count()),\n    'Amazon Elastic Container Service' : (responses_df_2020['Q27_B_Part_3'].count()),\n    'Azure Cloud Services' : (responses_df_2020['Q27_B_Part_4'].count()),\n    'Microsoft Azure Container Instances' : (responses_df_2020['Q27_B_Part_5'].count()),\n    'Azure Functions' : (responses_df_2020['Q27_B_Part_6'].count()),\n    'Google Cloud Compute Engine' : (responses_df_2020['Q27_B_Part_7'].count()),\n    'Google Cloud Functions' : (responses_df_2020['Q27_B_Part_8'].count()),\n    'Google Cloud Run' : (responses_df_2020['Q27_B_Part_9'].count()),\n    'Google Cloud App Engine' : (responses_df_2020['Q27_B_Part_10'].count()),\n    'No / None' : (responses_df_2020['Q27_B_Part_11'].count()),\n    'Other' : (responses_df_2020['Q27_B_OTHER'].count())\n}\n\nq28a_dictionary_of_counts_2020 = {\n    'Amazon SageMaker' : (responses_df_2020['Q28_A_Part_1'].count()),\n    'Amazon Forecast': (responses_df_2020['Q28_A_Part_2'].count()),\n    'Amazon Rekognition' : (responses_df_2020['Q28_A_Part_3'].count()),\n    'Azure Machine Learning Studio' : (responses_df_2020['Q28_A_Part_4'].count()),\n    'Azure Cognitive Services' : (responses_df_2020['Q28_A_Part_5'].count()),\n    'Google Cloud AI Platform / Google Cloud ML Engine' : (responses_df_2020['Q28_A_Part_6'].count()),\n    'Google Cloud Video AI' : (responses_df_2020['Q28_A_Part_7'].count()),\n    'Google Cloud Natural Language' : (responses_df_2020['Q28_A_Part_8'].count()),\n    'Google Cloud Vision AI' : (responses_df_2020['Q28_A_Part_9'].count()),\n    'No / None' : (responses_df_2020['Q28_A_Part_10'].count()),\n    'Other' : (responses_df_2020['Q28_A_OTHER'].count())\n}\n\nq28b_dictionary_of_counts_2020 = {\n    'Amazon SageMaker' : (responses_df_2020['Q28_B_Part_1'].count()),\n    'Amazon Forecast': (responses_df_2020['Q28_B_Part_2'].count()),\n    'Amazon Rekognition' : (responses_df_2020['Q28_B_Part_3'].count()),\n    'Azure Machine Learning Studio' : (responses_df_2020['Q28_B_Part_4'].count()),\n    'Azure Cognitive Services' : (responses_df_2020['Q28_B_Part_5'].count()),\n    'Google Cloud AI Platform / Google Cloud ML Engine' : (responses_df_2020['Q28_B_Part_6'].count()),\n    'Google Cloud Video AI' : (responses_df_2020['Q28_B_Part_7'].count()),\n    'Google Cloud Natural Language' : (responses_df_2020['Q28_B_Part_8'].count()),\n    'Google Cloud Vision AI' : (responses_df_2020['Q28_B_Part_9'].count()),\n    'No / None' : (responses_df_2020['Q28_B_Part_10'].count()),\n    'Other' : (responses_df_2020['Q28_B_OTHER'].count())\n}\n\n\nq29a_dictionary_of_counts_2020 = {\n    'MySQL' : (responses_df_2020['Q29_A_Part_1'].count()),\n    'PostgreSQL': (responses_df_2020['Q29_A_Part_2'].count()),\n    'SQLite' : (responses_df_2020['Q29_A_Part_3'].count()),\n    'Oracle Database' : (responses_df_2020['Q29_A_Part_4'].count()),\n    'MongoDB' : (responses_df_2020['Q29_A_Part_5'].count()),\n    'Snowflake' : (responses_df_2020['Q29_A_Part_6'].count()),\n    'IBM Db2' : (responses_df_2020['Q29_A_Part_7'].count()),\n    'Microsoft SQL Server' : (responses_df_2020['Q29_A_Part_8'].count()),\n    'Microsoft Access' : (responses_df_2020['Q29_A_Part_9'].count()),\n    'Microsoft Azure Data Lake Storage' : (responses_df_2020['Q29_A_Part_10'].count()),\n    'Amazon Redshift' : (responses_df_2020['Q29_A_Part_11'].count()),\n    'Amazon Athena' : (responses_df_2020['Q29_A_Part_12'].count()),\n    'Amazon DynamoDB' : (responses_df_2020['Q29_A_Part_13'].count()),\n    'Google Cloud BigQuery' : (responses_df_2020['Q29_A_Part_14'].count()),\n    'Google Cloud SQL' : (responses_df_2020['Q29_A_Part_15'].count()),\n    'Google Cloud Firestore' : (responses_df_2020['Q29_A_Part_16'].count()),\n    'None' : (responses_df_2020['Q29_A_Part_17'].count()),\n    'Other' : (responses_df_2020['Q29_A_OTHER'].count())\n}\n\n\nq29b_dictionary_of_counts_2020 = {\n    'MySQL' : (responses_df_2020['Q29_B_Part_1'].count()),\n    'PostgreSQL': (responses_df_2020['Q29_B_Part_2'].count()),\n    'SQLite' : (responses_df_2020['Q29_B_Part_3'].count()),\n    'Oracle Database' : (responses_df_2020['Q29_B_Part_4'].count()),\n    'MongoDB' : (responses_df_2020['Q29_B_Part_5'].count()),\n    'Snowflake' : (responses_df_2020['Q29_B_Part_6'].count()),\n    'IBM Db2' : (responses_df_2020['Q29_B_Part_7'].count()),\n    'Microsoft SQL Server' : (responses_df_2020['Q29_B_Part_8'].count()),\n    'Microsoft Access' : (responses_df_2020['Q29_B_Part_9'].count()),\n    'Microsoft Azure Data Lake Storage' : (responses_df_2020['Q29_B_Part_10'].count()),\n    'Amazon Redshift' : (responses_df_2020['Q29_B_Part_11'].count()),\n    'Amazon Athena' : (responses_df_2020['Q29_B_Part_12'].count()),\n    'Amazon DynamoDB' : (responses_df_2020['Q29_B_Part_13'].count()),\n    'Google Cloud BigQuery' : (responses_df_2020['Q29_B_Part_14'].count()),\n    'Google Cloud SQL' : (responses_df_2020['Q29_B_Part_15'].count()),\n    'Google Cloud Firestore' : (responses_df_2020['Q29_B_Part_16'].count()),\n    'None' : (responses_df_2020['Q29_B_Part_17'].count()),\n    'Other' : (responses_df_2020['Q29_B_OTHER'].count())\n}\n\nq31a_dictionary_of_counts_2020 = {\n    'Amazon QuickSight' : (responses_df_2020['Q31_A_Part_1'].count()),\n    'Microsoft Power BI': (responses_df_2020['Q31_A_Part_2'].count()),\n    'Google Data Studio' : (responses_df_2020['Q31_A_Part_3'].count()),\n    'Looker' : (responses_df_2020['Q31_A_Part_4'].count()),\n    'Tableau' : (responses_df_2020['Q31_A_Part_5'].count()),\n    'Salesforce' : (responses_df_2020['Q31_A_Part_6'].count()),\n    'Einstein Analytics' : (responses_df_2020['Q31_A_Part_7'].count()),\n    'Qlik' : (responses_df_2020['Q31_A_Part_8'].count()),\n    'Domo' : (responses_df_2020['Q31_A_Part_9'].count()),\n    'TIBCO Spotfire' : (responses_df_2020['Q31_A_Part_10'].count()),\n    'Alteryx' : (responses_df_2020['Q31_A_Part_11'].count()),\n    'Sisense' : (responses_df_2020['Q31_A_Part_12'].count()),\n    'SAP Analytics Cloud' : (responses_df_2020['Q31_A_Part_13'].count()),\n    'None' : (responses_df_2020['Q31_A_Part_14'].count()),\n    'Other' : (responses_df_2020['Q31_A_OTHER'].count())\n}\n\nq31b_dictionary_of_counts_2020 = {\n    'Amazon QuickSight' : (responses_df_2020['Q31_B_Part_1'].count()),\n    'Microsoft Power BI': (responses_df_2020['Q31_B_Part_2'].count()),\n    'Google Data Studio' : (responses_df_2020['Q31_B_Part_3'].count()),\n    'Looker' : (responses_df_2020['Q31_B_Part_4'].count()),\n    'Tableau' : (responses_df_2020['Q31_B_Part_5'].count()),\n    'Salesforce' : (responses_df_2020['Q31_B_Part_6'].count()),\n    'Einstein Analytics' : (responses_df_2020['Q31_B_Part_7'].count()),\n    'Qlik' : (responses_df_2020['Q31_B_Part_8'].count()),\n    'Domo' : (responses_df_2020['Q31_B_Part_9'].count()),\n    'TIBCO Spotfire' : (responses_df_2020['Q31_B_Part_10'].count()),\n    'Alteryx' : (responses_df_2020['Q31_B_Part_11'].count()),\n    'Sisense' : (responses_df_2020['Q31_B_Part_12'].count()),\n    'SAP Analytics Cloud' : (responses_df_2020['Q31_B_Part_13'].count()),\n    'None' : (responses_df_2020['Q31_B_Part_14'].count()),\n    'Other' : (responses_df_2020['Q31_B_OTHER'].count())\n}\n\nq33a_dictionary_of_counts_2020 = {\n    'Automated data augmentation (e.g. imgaug, albumentations)' : (responses_df_2020['Q33_A_Part_1'].count()),\n    'Automated feature engineering/selection (e.g. tpot, boruta_py)': (responses_df_2020['Q33_A_Part_2'].count()),\n    'Automated model selection (e.g. auto-sklearn, xcessiv)' : (responses_df_2020['Q33_A_Part_3'].count()),\n    'Automated model architecture searches (e.g. darts, enas)' : (responses_df_2020['Q33_A_Part_4'].count()),\n    'Automated hyperparameter tuning (e.g. hyperopt, ray.tune, Vizier)' : (responses_df_2020['Q33_A_Part_5'].count()),\n    'Automation of full ML pipelines (e.g. Google AutoML, H20 Driverless AI)' : (responses_df_2020['Q33_A_Part_6'].count()),\n    'No / None' : (responses_df_2020['Q33_A_Part_7'].count()),\n    'Other' : (responses_df_2020['Q33_A_OTHER'].count())\n}\n\nq33b_dictionary_of_counts_2020 = {\n    'Automated data augmentation (e.g. imgaug, albumentations)' : (responses_df_2020['Q33_B_Part_1'].count()),\n    'Automated feature engineering/selection (e.g. tpot, boruta_py)': (responses_df_2020['Q33_B_Part_2'].count()),\n    'Automated model selection (e.g. auto-sklearn, xcessiv)' : (responses_df_2020['Q33_B_Part_3'].count()),\n    'Automated model architecture searches (e.g. darts, enas)' : (responses_df_2020['Q33_B_Part_4'].count()),\n    'Automated hyperparameter tuning (e.g. hyperopt, ray.tune, Vizier)' : (responses_df_2020['Q33_B_Part_5'].count()),\n    'Automation of full ML pipelines (e.g. Google AutoML, H20 Driverless AI)' : (responses_df_2020['Q33_B_Part_6'].count()),\n    'No / None' : (responses_df_2020['Q33_B_Part_7'].count()),\n    'Other' : (responses_df_2020['Q33_B_OTHER'].count())\n}\n\nq34a_dictionary_of_counts_2020 = {\n    'Google Cloud AutoML' : (responses_df_2020['Q34_A_Part_1'].count()),\n    'H20 Driverless AI': (responses_df_2020['Q34_A_Part_2'].count()),\n    'Databricks AutoML' : (responses_df_2020['Q34_A_Part_3'].count()),\n    'DataRobot AutoML' : (responses_df_2020['Q34_A_Part_4'].count()),\n    'Tpot' : (responses_df_2020['Q34_A_Part_5'].count()),\n    'Auto-Keras' : (responses_df_2020['Q34_A_Part_6'].count()),\n    'Auto-Sklearn' : (responses_df_2020['Q34_A_Part_7'].count()),\n    'Auto_ml' : (responses_df_2020['Q34_A_Part_8'].count()),\n    'Xcessiv' : (responses_df_2020['Q34_A_Part_9'].count()),\n    'MLbox' : (responses_df_2020['Q34_A_Part_10'].count()),\n    'No / None' : (responses_df_2020['Q34_A_Part_11'].count()),\n    'Other' : (responses_df_2020['Q34_A_OTHER'].count())\n}\n\nq34b_dictionary_of_counts_2020 = {\n    'Google Cloud AutoML' : (responses_df_2020['Q34_B_Part_1'].count()),\n    'H20 Driverless AI': (responses_df_2020['Q34_B_Part_2'].count()),\n    'Databricks AutoML' : (responses_df_2020['Q34_B_Part_3'].count()),\n    'DataRobot AutoML' : (responses_df_2020['Q34_B_Part_4'].count()),\n    'Tpot' : (responses_df_2020['Q34_B_Part_5'].count()),\n    'Auto-Keras' : (responses_df_2020['Q34_B_Part_6'].count()),\n    'Auto-Sklearn' : (responses_df_2020['Q34_B_Part_7'].count()),\n    'Auto_ml' : (responses_df_2020['Q34_B_Part_8'].count()),\n    'Xcessiv' : (responses_df_2020['Q34_B_Part_9'].count()),\n    'MLbox' : (responses_df_2020['Q34_B_Part_10'].count()),\n    'No / None' : (responses_df_2020['Q34_B_Part_11'].count()),\n    'Other' : (responses_df_2020['Q34_B_OTHER'].count())\n}\n\n\nq35a_dictionary_of_counts_2020 = {\n    'Neptune.ai' : (responses_df_2020['Q35_A_Part_1'].count()),\n    'Weights & Biases': (responses_df_2020['Q35_A_Part_2'].count()),\n    'Comet.ml' : (responses_df_2020['Q35_A_Part_3'].count()),\n    'Sacred + Omniboard' : (responses_df_2020['Q35_A_Part_4'].count()),\n    'TensorBoard' : (responses_df_2020['Q35_A_Part_5'].count()),\n    'Guild.ai' : (responses_df_2020['Q35_A_Part_6'].count()),\n    'Polyaxon' : (responses_df_2020['Q35_A_Part_7'].count()),\n    'Trains' : (responses_df_2020['Q35_A_Part_8'].count()),\n    'Domino Model Monitor' : (responses_df_2020['Q35_A_Part_9'].count()),\n    'No / None' : (responses_df_2020['Q35_A_Part_10'].count()),\n    'Other' : (responses_df_2020['Q35_A_OTHER'].count())\n}\n\n\nq35b_dictionary_of_counts_2020 = {\n    'Neptune.ai' : (responses_df_2020['Q35_B_Part_1'].count()),\n    'Weights & Biases': (responses_df_2020['Q35_B_Part_2'].count()),\n    'Comet.ml' : (responses_df_2020['Q35_B_Part_3'].count()),\n    'Sacred + Omniboard' : (responses_df_2020['Q35_B_Part_4'].count()),\n    'TensorBoard' : (responses_df_2020['Q35_B_Part_5'].count()),\n    'Guild.ai' : (responses_df_2020['Q35_B_Part_6'].count()),\n    'Polyaxon' : (responses_df_2020['Q35_B_Part_7'].count()),\n    'Trains' : (responses_df_2020['Q35_B_Part_8'].count()),\n    'Domino Model Monitor' : (responses_df_2020['Q35_B_Part_9'].count()),\n    'No / None' : (responses_df_2020['Q35_B_Part_10'].count()),\n    'Other' : (responses_df_2020['Q35_B_OTHER'].count())\n}\n\nq36_dictionary_of_counts_2020 = {\n    'Plotly Dash' : (responses_df_2020['Q36_Part_1'].count()),\n    'Streamlit': (responses_df_2020['Q36_Part_2'].count()),\n    'NBViewer' : (responses_df_2020['Q36_Part_3'].count()),\n    'GitHub' : (responses_df_2020['Q36_Part_4'].count()),\n    'Personal Blog' : (responses_df_2020['Q36_Part_5'].count()),\n    'Kaggle' : (responses_df_2020['Q36_Part_6'].count()),\n    'Colab' : (responses_df_2020['Q36_Part_7'].count()),\n    'Shiny' : (responses_df_2020['Q36_Part_8'].count()),\n    'None / I do not share my work publicly' : (responses_df_2020['Q36_Part_9'].count()),\n    'Other' : (responses_df_2020['Q36_OTHER'].count())\n}\n\n\nq37_dictionary_of_counts_2020 = {\n    'Coursera' : (responses_df_2020['Q37_Part_1'].count()),\n    'EdX': (responses_df_2020['Q37_Part_2'].count()),\n    'Kaggle Learn Courses' : (responses_df_2020['Q37_Part_3'].count()),\n    'DataCamp' : (responses_df_2020['Q37_Part_4'].count()),\n    'Fast.ai' : (responses_df_2020['Q37_Part_5'].count()),\n    'Udacity' : (responses_df_2020['Q37_Part_6'].count()),\n    'Udemy' : (responses_df_2020['Q37_Part_7'].count()),\n    'LinkedIn Learning' : (responses_df_2020['Q37_Part_8'].count()),\n    'Cloud-certification programs' : (responses_df_2020['Q37_Part_9'].count()),\n    'University Courses' : (responses_df_2020['Q37_Part_10'].count()),\n    'None' : (responses_df_2020['Q37_Part_11'].count()),\n    'Other' : (responses_df_2020['Q37_OTHER'].count())\n}\n\n\nq39_dictionary_of_counts_2020 = {\n    'Twitter (data science influencers)' : (responses_df_2020['Q39_Part_1'].count()),\n    'Email newsletters (Data Elixir, OReilly Data & AI, etc)': (responses_df_2020['Q39_Part_2'].count()),\n    'Reddit (r/machinelearning, etc)' : (responses_df_2020['Q39_Part_3'].count()),\n    'Kaggle (notebooks, forums, etc)' : (responses_df_2020['Q39_Part_4'].count()),\n    'Course Forums (forums.fast.ai, Coursera forums, etc)' : (responses_df_2020['Q39_Part_5'].count()),\n    'YouTube (Kaggle YouTube, Cloud AI Adventures, etc)' : (responses_df_2020['Q39_Part_6'].count()),\n    'Podcasts (Chai Time Data Science, OReilly Data Show, etc)' : (responses_df_2020['Q39_Part_7'].count()),\n    'Blogs (Towards Data Science, Analytics Vidhya, etc)' : (responses_df_2020['Q39_Part_8'].count()),\n    'Journal Publications (peer-reviewed journals, conference proceedings, etc)' : (responses_df_2020['Q39_Part_9'].count()),\n    'Slack Communities (ods.ai, kagglenoobs, etc)' : (responses_df_2020['Q39_Part_10'].count()),\n    'None' : (responses_df_2020['Q39_Part_11'].count()),\n    'Other' : (responses_df_2020['Q39_OTHER'].count())\n}\n\n# Questions where respondents can select more than one answer choice have been split into multiple columns.\n# These dictionaries contain value counts for every answer choice for every multiple-column question.\n\nq7_dictionary_of_counts_2021 = {\n    'Python' : (responses_df_2021['Q7_Part_1'].count()),\n    'R': (responses_df_2021['Q7_Part_2'].count()),\n    'SQL' : (responses_df_2021['Q7_Part_3'].count()),\n    'C' : (responses_df_2021['Q7_Part_4'].count()),\n    'C++' : (responses_df_2021['Q7_Part_5'].count()),\n    'Java' : (responses_df_2021['Q7_Part_6'].count()),\n    'Javascript' : (responses_df_2021['Q7_Part_7'].count()),\n    'Julia' : (responses_df_2021['Q7_Part_8'].count()),\n    'Swift' : (responses_df_2021['Q7_Part_9'].count()),\n    'Bash' : (responses_df_2021['Q7_Part_10'].count()),\n    'MATLAB' : (responses_df_2021['Q7_Part_11'].count()),\n    'None' : (responses_df_2021['Q7_Part_12'].count()),\n    'Other' : (responses_df_2021['Q7_OTHER'].count())\n}\n\nq9_dictionary_of_counts_2021 = {\n    'JupyterLab' : (responses_df_2021['Q9_Part_1'].count()),\n    'RStudio': (responses_df_2021['Q9_Part_2'].count()),\n    'Visual Studio' : (responses_df_2021['Q9_Part_3'].count()),\n    'Visual Studio Code (VSCode)' : (responses_df_2021['Q9_Part_4'].count()),\n    'PyCharm' : (responses_df_2021['Q9_Part_5'].count()),\n    'Spyder' : (responses_df_2021['Q9_Part_6'].count()),\n    'Notepad++' : (responses_df_2021['Q9_Part_7'].count()),\n    'Sublime Text' : (responses_df_2021['Q9_Part_8'].count()),\n    'Vim, Emacs, or similar' : (responses_df_2021['Q9_Part_9'].count()),\n    'MATLAB' : (responses_df_2021['Q9_Part_10'].count()),\n    'Jupyter Notebook' : (responses_df_2021['Q9_Part_11'].count()),    \n    'None' : (responses_df_2021['Q9_Part_12'].count()),\n    'Other' : (responses_df_2021['Q9_OTHER'].count())\n}\n\nq10_dictionary_of_counts_2021 = {\n    'Kaggle Notebooks' : (responses_df_2021['Q10_Part_1'].count()),\n    'Colab Notebooks': (responses_df_2021['Q10_Part_2'].count()),\n    'Azure Notebooks' : (responses_df_2021['Q10_Part_3'].count()),\n    'Paperspace / Gradient' : (responses_df_2021['Q10_Part_4'].count()),\n    'Binder / JupyterHub' : (responses_df_2021['Q10_Part_5'].count()),\n    'Code Ocean' : (responses_df_2021['Q10_Part_6'].count()),\n    'IBM Watson Studio' : (responses_df_2021['Q10_Part_7'].count()),\n    'Amazon Sagemaker Studio Notebooks' : (responses_df_2021['Q10_Part_8'].count()),\n    'Amazon EMR Notebooks' : (responses_df_2021['Q10_Part_9'].count()),\n    'Google Cloud Notebooks (AI Platform / Vertex AI)' : (responses_df_2021['Q10_Part_10'].count()),\n    'Google Cloud Datalab' : (responses_df_2021['Q10_Part_11'].count()),\n    'Databricks Collaborative Notebooks' : (responses_df_2021['Q10_Part_12'].count()),\n    'Zeppelin / Zepl Notebooks' : (responses_df_2021['Q10_Part_13'].count()),\n    'Deepnote Notebooks' : (responses_df_2021['Q10_Part_14'].count()),\n    'Observable Notebooks' : (responses_df_2021['Q10_Part_15'].count()),\n    'None' : (responses_df_2021['Q10_Part_16'].count()),\n    'Other' : (responses_df_2021['Q10_OTHER'].count())\n}\n\nq12_dictionary_of_counts_2021 = {\n    'NVIDIA GPUs' : (responses_df_2021['Q12_Part_1'].count()),\n    'Google Cloud TPUs': (responses_df_2021['Q12_Part_2'].count()),\n    'AWS Trainium Chips': (responses_df_2021['Q12_Part_3'].count()),\n    'AWS Inferentia Chips': (responses_df_2021['Q12_Part_4'].count()),\n    'None' : (responses_df_2021['Q12_Part_5'].count()),\n    'Other' : (responses_df_2021['Q12_OTHER'].count())\n}\n\nq14_dictionary_of_counts_2021 = {\n    'Matplotlib' : (responses_df_2021['Q14_Part_1'].count()),\n    'Seaborn': (responses_df_2021['Q14_Part_2'].count()),\n    'Plotly / Plotly Express' : (responses_df_2021['Q14_Part_3'].count()),\n    'Ggplot / ggplot2' : (responses_df_2021['Q14_Part_4'].count()),\n    'Shiny' : (responses_df_2021['Q14_Part_5'].count()),\n    'D3.js' : (responses_df_2021['Q14_Part_6'].count()),\n    'Altair' : (responses_df_2021['Q14_Part_7'].count()),\n    'Bokeh' : (responses_df_2021['Q14_Part_8'].count()),\n    'Geoplotlib' : (responses_df_2021['Q14_Part_9'].count()),\n    'Leaflet / Folium' : (responses_df_2021['Q14_Part_10'].count()),\n    'None' : (responses_df_2021['Q14_Part_11'].count()),\n    'Other' : (responses_df_2021['Q14_OTHER'].count())\n}\n\nq16_dictionary_of_counts_2021 = {\n    'Scikit-learn' : (responses_df_2021['Q16_Part_1'].count()),\n    'TensorFlow': (responses_df_2021['Q16_Part_2'].count()),\n    'Keras' : (responses_df_2021['Q16_Part_3'].count()),\n    'PyTorch' : (responses_df_2021['Q16_Part_4'].count()),\n    'Fast.ai' : (responses_df_2021['Q16_Part_5'].count()),\n    'MXNet' : (responses_df_2021['Q16_Part_6'].count()),\n    'Xgboost' : (responses_df_2021['Q16_Part_7'].count()),\n    'LightGBM' : (responses_df_2021['Q16_Part_8'].count()),\n    'CatBoost' : (responses_df_2021['Q16_Part_9'].count()),\n    'Prophet' : (responses_df_2021['Q16_Part_10'].count()),\n    'H20-3' : (responses_df_2021['Q16_Part_11'].count()),\n    'Caret' : (responses_df_2021['Q16_Part_12'].count()),\n    'Tidymodels' : (responses_df_2021['Q16_Part_13'].count()),\n    'JAX' : (responses_df_2021['Q16_Part_14'].count()),\n    'PyTorch Lightning' : (responses_df_2021['Q16_Part_15'].count()),\\\n    'Huggingface' : (responses_df_2021['Q16_Part_16'].count()),\n    'None' : (responses_df_2021['Q16_Part_17'].count()),\n    'Other' : (responses_df_2021['Q16_OTHER'].count())\n}\n\nq17_dictionary_of_counts_2021 = {\n    'Linear or Logistic Regression' : (responses_df_2021['Q17_Part_1'].count()),\n    'Decision Trees or Random Forests': (responses_df_2021['Q17_Part_2'].count()),\n    'Gradient Boosting Machines (xgboost, lightgbm, etc)' : (responses_df_2021['Q17_Part_3'].count()),\n    'Bayesian Approaches' : (responses_df_2021['Q17_Part_4'].count()),\n    'Evolutionary Approaches' : (responses_df_2021['Q17_Part_5'].count()),\n    'Dense Neural Networks (MLPs, etc)' : (responses_df_2021['Q17_Part_6'].count()),\n    'Convolutional Neural Networks' : (responses_df_2021['Q17_Part_7'].count()),\n    'Generative Adversarial Networks' : (responses_df_2021['Q17_Part_8'].count()),\n    'Recurrent Neural Networks' : (responses_df_2021['Q17_Part_9'].count()),\n    'Transformer Networks (BERT, gpt-3, etc)' : (responses_df_2021['Q17_Part_10'].count()),\n    'None' : (responses_df_2021['Q17_Part_11'].count()),\n    'Other' : (responses_df_2021['Q17_OTHER'].count())\n}\n\n\nq18_dictionary_of_counts_2021 = {\n    'General purpose image/video tools (PIL, cv2, skimage, etc)' : (responses_df_2021['Q18_Part_1'].count()),\n    'Image segmentation methods (U-Net, Mask R-CNN, etc)': (responses_df_2021['Q18_Part_2'].count()),\n    'Object detection methods (YOLOv3, RetinaNet, etc)' : (responses_df_2021['Q18_Part_3'].count()),\n    'Image classification and other general purpose networks (VGG, Inception, ResNet, ResNeXt, NASNet, EfficientNet, etc)' : (responses_df_2021['Q18_Part_4'].count()),\n    'Generative Networks (GAN, VAE, etc)' : (responses_df_2021['Q18_Part_5'].count()),\n    'None' : (responses_df_2021['Q18_Part_6'].count()),\n    'Other' : (responses_df_2021['Q18_OTHER'].count())\n}\n\n\nq19_dictionary_of_counts_2021 = {\n    'Word embeddings/vectors (GLoVe, fastText, word2vec)' : (responses_df_2021['Q19_Part_1'].count()),\n    'Encoder-decoder models (seq2seq, vanilla transformers)': (responses_df_2021['Q19_Part_2'].count()),\n    'Contextualized embeddings (ELMo, CoVe)' : (responses_df_2021['Q19_Part_3'].count()),\n    'Transformer language models (GPT-3, BERT, XLnet, etc)' : (responses_df_2021['Q19_Part_4'].count()),\n    'None' : (responses_df_2021['Q19_Part_5'].count()),\n    'Other' : (responses_df_2021['Q19_OTHER'].count())\n}\n\n\nq24_dictionary_of_counts_2021 = {\n    'Analyze and understand data to influence product or business decisions' : (responses_df_2021['Q24_Part_1'].count()),\n    'Build and/or run the data infrastructure that my business uses for storing, analyzing, and operationalizing data': (responses_df_2021['Q24_Part_2'].count()),\n    'Build prototypes to explore applying machine learning to new areas' : (responses_df_2021['Q24_Part_3'].count()),\n    'Build and/or run a machine learning service that operationally improves my product or workflows' : (responses_df_2021['Q24_Part_4'].count()),\n    'Experimentation and iteration to improve existing ML models' : (responses_df_2021['Q24_Part_5'].count()),\n    'Do research that advances the state of the art of machine learning' : (responses_df_2021['Q24_Part_6'].count()),\n    'None of these activities are an important part of my role at work' : (responses_df_2021['Q24_Part_7'].count()),\n    'Other' : (responses_df_2021['Q24_OTHER'].count())\n}\n\n\nq27a_dictionary_of_counts_2021 = {\n    'Amazon Web Services (AWS)' : (responses_df_2021['Q27_A_Part_1'].count()),\n    'Microsoft Azure': (responses_df_2021['Q27_A_Part_2'].count()),\n    'Google Cloud Platform (GCP)' : (responses_df_2021['Q27_A_Part_3'].count()),\n    'IBM Cloud / Red Hat' : (responses_df_2021['Q27_A_Part_4'].count()),\n    'Oracle Cloud' : (responses_df_2021['Q27_A_Part_5'].count()),\n    'SAP Cloud' : (responses_df_2021['Q27_A_Part_6'].count()),\n    'Salesforce Cloud' : (responses_df_2021['Q27_A_Part_7'].count()),\n    'VMware Cloud' : (responses_df_2021['Q27_A_Part_8'].count()),\n    'Alibaba Cloud' : (responses_df_2021['Q27_A_Part_9'].count()),\n    'Tencent Cloud' : (responses_df_2021['Q27_A_Part_10'].count()),\n    'None' : (responses_df_2021['Q27_A_Part_11'].count()),\n    'Other' : (responses_df_2021['Q27_A_OTHER'].count())\n}\n\nq27b_dictionary_of_counts_2021 = {\n    'Amazon Web Services (AWS)' : (responses_df_2021['Q27_B_Part_1'].count()),\n    'Microsoft Azure': (responses_df_2021['Q27_B_Part_2'].count()),\n    'Google Cloud Platform (GCP)' : (responses_df_2021['Q27_B_Part_3'].count()),\n    'IBM Cloud / Red Hat' : (responses_df_2021['Q27_B_Part_4'].count()),\n    'Oracle Cloud' : (responses_df_2021['Q27_B_Part_5'].count()),\n    'SAP Cloud' : (responses_df_2021['Q27_B_Part_6'].count()),\n    'Salesforce Cloud' : (responses_df_2021['Q27_B_Part_7'].count()),\n    'VMware Cloud' : (responses_df_2021['Q27_B_Part_8'].count()),\n    'Alibaba Cloud' : (responses_df_2021['Q27_B_Part_9'].count()),\n    'Tencent Cloud' : (responses_df_2021['Q27_B_Part_10'].count()),\n    'None' : (responses_df_2021['Q27_B_Part_11'].count()),\n    'Other' : (responses_df_2021['Q27_B_OTHER'].count())\n}\n\nq29a_dictionary_of_counts_2021 = {\n    'Amazon Elastic Compute Cloud (EC2)' : (responses_df_2021['Q29_A_Part_1'].count()),\n    'Microsoft Azure Virtual Machines' : (responses_df_2021['Q29_A_Part_2'].count()),\n    'Google Cloud Compute Engine' : (responses_df_2021['Q29_A_Part_3'].count()),\n    'No / None' : (responses_df_2021['Q29_A_Part_4'].count()),\n    'Other' : (responses_df_2021['Q29_A_OTHER'].count())\n}\n\nq29b_dictionary_of_counts_2021 = {\n    'Amazon Elastic Compute Cloud (EC2)' : (responses_df_2021['Q29_B_Part_1'].count()),\n    'Microsoft Azure Virtual Machines' : (responses_df_2021['Q29_B_Part_2'].count()),\n    'Google Cloud Compute Engine' : (responses_df_2021['Q29_B_Part_3'].count()),\n    'No / None' : (responses_df_2021['Q29_B_Part_4'].count()),\n    'Other' : (responses_df_2021['Q29_B_OTHER'].count())\n}\n\nq30a_dictionary_of_counts_2021 = {\n    'Microsoft Azure Data Lake Storage' : (responses_df_2021['Q30_A_Part_1'].count()),\n    'Microsoft Azure Disk Storage': (responses_df_2021['Q30_A_Part_2'].count()),\n    'Amazon Simple Storage Service (S3) ' : (responses_df_2021['Q30_A_Part_3'].count()),\n    'Amazon Elastic File System (EFS) ' : (responses_df_2021['Q30_A_Part_4'].count()),\n    'Google Cloud Storage (GCS) ' : (responses_df_2021['Q30_A_Part_5'].count()),\n    'Google Cloud Filestore' : (responses_df_2021['Q30_A_Part_6'].count()),\n    'No / None' : (responses_df_2021['Q30_A_Part_7'].count()),\n    'Other' : (responses_df_2021['Q30_A_OTHER'].count())\n}\n\nq30b_dictionary_of_counts_2021 = {\n    'Microsoft Azure Data Lake Storage' : (responses_df_2021['Q30_B_Part_1'].count()),\n    'Microsoft Azure Disk Storage': (responses_df_2021['Q30_B_Part_2'].count()),\n    'Amazon Simple Storage Service (S3) ' : (responses_df_2021['Q30_B_Part_3'].count()),\n    'Amazon Elastic File System (EFS) ' : (responses_df_2021['Q30_B_Part_4'].count()),\n    'Google Cloud Storage (GCS) ' : (responses_df_2021['Q30_B_Part_5'].count()),\n    'Google Cloud Filestore' : (responses_df_2021['Q30_B_Part_6'].count()),\n    'No / None' : (responses_df_2021['Q30_B_Part_7'].count()),\n    'Other' : (responses_df_2021['Q30_B_OTHER'].count())\n}\n\nq31a_dictionary_of_counts_2021 = {\n    'Amazon SageMaker' : (responses_df_2021['Q31_A_Part_1'].count()),\n    'Azure Machine Learning Studio': (responses_df_2021['Q31_A_Part_2'].count()),\n    'Google Cloud Vertex AI' : (responses_df_2021['Q31_A_Part_3'].count()),\n    'DataRobot' : (responses_df_2021['Q31_A_Part_4'].count()),\n    'Databricks' : (responses_df_2021['Q31_A_Part_5'].count()),\n    'Dataiku' : (responses_df_2021['Q31_A_Part_6'].count()),\n    'Alteryx' : (responses_df_2021['Q31_A_Part_7'].count()),\n    'Rapidminer' : (responses_df_2021['Q31_A_Part_8'].count()),\n    'No / None' : (responses_df_2021['Q31_A_Part_9'].count()),\n    'Other' : (responses_df_2021['Q31_A_OTHER'].count())\n}\n\nq31b_dictionary_of_counts_2021 = {\n    'Amazon SageMaker' : (responses_df_2021['Q31_B_Part_1'].count()),\n    'Azure Machine Learning Studio': (responses_df_2021['Q31_B_Part_2'].count()),\n    'Google Cloud Vertex AI' : (responses_df_2021['Q31_B_Part_3'].count()),\n    'DataRobot' : (responses_df_2021['Q31_B_Part_4'].count()),\n    'Databricks' : (responses_df_2021['Q31_B_Part_5'].count()),\n    'Dataiku' : (responses_df_2021['Q31_B_Part_6'].count()),\n    'Alteryx' : (responses_df_2021['Q31_B_Part_7'].count()),\n    'Rapidminer' : (responses_df_2021['Q31_B_Part_8'].count()),\n    'No / None' : (responses_df_2021['Q31_B_Part_9'].count()),\n    'Other' : (responses_df_2021['Q31_B_OTHER'].count())\n}\n\nq32a_dictionary_of_counts_2021 = { \n    'MySQL' : (responses_df_2021['Q32_A_Part_1'].count()),\n    'PostgreSQL': (responses_df_2021['Q32_A_Part_2'].count()),\n    'SQLite' : (responses_df_2021['Q32_A_Part_3'].count()),\n    'Oracle Database' : (responses_df_2021['Q32_A_Part_4'].count()),\n    'MongoDB' : (responses_df_2021['Q32_A_Part_5'].count()),\n    'Snowflake' : (responses_df_2021['Q32_A_Part_6'].count()),\n    'IBM Db2' : (responses_df_2021['Q32_A_Part_7'].count()),\n    'Microsoft SQL Server' : (responses_df_2021['Q32_A_Part_8'].count()),\n    'Microsoft Azure SQL Database' : (responses_df_2021['Q32_A_Part_9'].count()), \n    'Microsoft Azure Cosmos DB' : (responses_df_2021['Q32_A_Part_10'].count()),\n    'Amazon Redshift' : (responses_df_2021['Q32_A_Part_11'].count()), \n    'Amazon Aurora' : (responses_df_2021['Q32_A_Part_12'].count()),\n    'Amazon RDS' : (responses_df_2021['Q32_A_Part_13'].count()),\n    'Amazon DynamoDB' : (responses_df_2021['Q32_A_Part_14'].count()),\n    'Google Cloud BigQuery' : (responses_df_2021['Q32_A_Part_15'].count()),\n    'Google Cloud SQL' : (responses_df_2021['Q32_A_Part_16'].count()),\n    'Google Cloud Firestore' : (responses_df_2021['Q32_A_Part_17'].count()),\n    'Google Cloud BigTable' : (responses_df_2021['Q32_A_Part_18'].count()),\n    'Google Cloud Spanner' : (responses_df_2021['Q32_A_Part_19'].count()),\n    'None' : (responses_df_2021['Q32_A_Part_20'].count()),\n    'Other' : (responses_df_2021['Q32_A_OTHER'].count())\n}\n\n\nq32b_dictionary_of_counts_2021 = {\n    'MySQL' : (responses_df_2021['Q32_B_Part_1'].count()),\n    'PostgreSQL': (responses_df_2021['Q32_B_Part_2'].count()),\n    'SQLite' : (responses_df_2021['Q32_B_Part_3'].count()),\n    'Oracle Database' : (responses_df_2021['Q32_B_Part_4'].count()),\n    'MongoDB' : (responses_df_2021['Q32_B_Part_5'].count()),\n    'Snowflake' : (responses_df_2021['Q32_B_Part_6'].count()),\n    'IBM Db2' : (responses_df_2021['Q32_B_Part_7'].count()),\n    'Microsoft SQL Server' : (responses_df_2021['Q32_B_Part_8'].count()),\n    'Microsoft Azure SQL Database' : (responses_df_2021['Q32_B_Part_9'].count()), \n    'Microsoft Azure Cosmos DB' : (responses_df_2021['Q32_B_Part_10'].count()),\n    'Amazon Redshift' : (responses_df_2021['Q32_B_Part_11'].count()), \n    'Amazon Aurora' : (responses_df_2021['Q32_B_Part_12'].count()),\n    'Amazon RDS' : (responses_df_2021['Q32_B_Part_13'].count()),\n    'Amazon DynamoDB' : (responses_df_2021['Q32_B_Part_14'].count()),\n    'Google Cloud BigQuery' : (responses_df_2021['Q32_B_Part_15'].count()),\n    'Google Cloud SQL' : (responses_df_2021['Q32_B_Part_16'].count()),\n    'Google Cloud Firestore' : (responses_df_2021['Q32_B_Part_17'].count()),\n    'Google Cloud BigTable' : (responses_df_2021['Q32_B_Part_18'].count()),\n    'Google Cloud Spanner' : (responses_df_2021['Q32_B_Part_19'].count()),\n    'None' : (responses_df_2021['Q32_B_Part_20'].count()),\n    'Other' : (responses_df_2021['Q32_B_OTHER'].count())\n}\n\nq34a_dictionary_of_counts_2021 = { \n    'Amazon QuickSight' : (responses_df_2021['Q34_A_Part_1'].count()),\n    'Microsoft Power BI': (responses_df_2021['Q34_A_Part_2'].count()),\n    'Google Data Studio' : (responses_df_2021['Q34_A_Part_3'].count()),\n    'Looker' : (responses_df_2021['Q34_A_Part_4'].count()),\n    'Tableau' : (responses_df_2021['Q34_A_Part_5'].count()),\n    'Salesforce' : (responses_df_2021['Q34_A_Part_6'].count()),\n    'Tableau CRM' : (responses_df_2021['Q34_A_Part_7'].count()),\n    'Qlik' : (responses_df_2021['Q34_A_Part_8'].count()),\n    'Domo' : (responses_df_2021['Q34_A_Part_9'].count()),\n    'TIBCO Spotfire' : (responses_df_2021['Q34_A_Part_10'].count()),\n    'Alteryx' : (responses_df_2021['Q34_A_Part_11'].count()),\n    'Sisense' : (responses_df_2021['Q34_A_Part_12'].count()),\n    'SAP Analytics Cloud' : (responses_df_2021['Q34_A_Part_13'].count()),\n    'Microsoft Azure Synapse' : (responses_df_2021['Q34_A_Part_14'].count()),\n    'Thoughtspot' : (responses_df_2021['Q34_A_Part_15'].count()),\n    'None' : (responses_df_2021['Q34_A_Part_16'].count()),\n    'Other' : (responses_df_2021['Q34_A_OTHER'].count())\n}\n\nq34b_dictionary_of_counts_2021 = {\n    'Amazon QuickSight' : (responses_df_2021['Q34_B_Part_1'].count()),\n    'Microsoft Power BI': (responses_df_2021['Q34_B_Part_2'].count()),\n    'Google Data Studio' : (responses_df_2021['Q34_B_Part_3'].count()),\n    'Looker' : (responses_df_2021['Q34_B_Part_4'].count()),\n    'Tableau' : (responses_df_2021['Q34_B_Part_5'].count()),\n    'Salesforce' : (responses_df_2021['Q34_B_Part_6'].count()),\n    'Tableau CRM' : (responses_df_2021['Q34_B_Part_7'].count()),\n    'Qlik' : (responses_df_2021['Q34_B_Part_8'].count()),\n    'Domo' : (responses_df_2021['Q34_B_Part_9'].count()),\n    'TIBCO Spotfire' : (responses_df_2021['Q34_B_Part_10'].count()),\n    'Alteryx' : (responses_df_2021['Q34_B_Part_11'].count()),\n    'Sisense' : (responses_df_2021['Q34_B_Part_12'].count()),\n    'SAP Analytics Cloud' : (responses_df_2021['Q34_B_Part_13'].count()),\n    'Microsoft Azure Synapse' : (responses_df_2021['Q34_B_Part_14'].count()),\n    'Thoughtspot' : (responses_df_2021['Q34_B_Part_15'].count()),\n    'None' : (responses_df_2021['Q34_B_Part_16'].count()),\n    'Other' : (responses_df_2021['Q34_B_OTHER'].count())\n}\n\nq36a_dictionary_of_counts_2021 = {\n    'Automated data augmentation (e.g. imgaug, albumentations)' : (responses_df_2021['Q36_A_Part_1'].count()),\n    'Automated feature engineering/selection (e.g. tpot, boruta_py)': (responses_df_2021['Q36_A_Part_2'].count()),\n    'Automated model selection (e.g. auto-sklearn, xcessiv)' : (responses_df_2021['Q36_A_Part_3'].count()),\n    'Automated model architecture searches (e.g. darts, enas)' : (responses_df_2021['Q36_A_Part_4'].count()),\n    'Automated hyperparameter tuning (e.g. hyperopt, ray.tune, Vizier)' : (responses_df_2021['Q36_A_Part_5'].count()),\n    'Automation of full ML pipelines (e.g. Google AutoML, H20 Driverless AI)' : (responses_df_2021['Q36_A_Part_6'].count()),\n    'No / None' : (responses_df_2021['Q36_A_Part_7'].count()),\n    'Other' : (responses_df_2021['Q36_A_OTHER'].count())\n}\n\nq36b_dictionary_of_counts_2021 = {\n    'Automated data augmentation (e.g. imgaug, albumentations)' : (responses_df_2021['Q36_B_Part_1'].count()),\n    'Automated feature engineering/selection (e.g. tpot, boruta_py)': (responses_df_2021['Q36_B_Part_2'].count()),\n    'Automated model selection (e.g. auto-sklearn, xcessiv)' : (responses_df_2021['Q36_B_Part_3'].count()),\n    'Automated model architecture searches (e.g. darts, enas)' : (responses_df_2021['Q36_B_Part_4'].count()),\n    'Automated hyperparameter tuning (e.g. hyperopt, ray.tune, Vizier)' : (responses_df_2021['Q36_B_Part_5'].count()),\n    'Automation of full ML pipelines (e.g. Google AutoML, H20 Driverless AI)' : (responses_df_2021['Q36_B_Part_6'].count()),\n    'No / None' : (responses_df_2021['Q36_B_Part_7'].count()),\n    'Other' : (responses_df_2021['Q36_B_OTHER'].count())\n}\n\nq37a_dictionary_of_counts_2021 = {\n    'Google Cloud AutoML' : (responses_df_2021['Q37_A_Part_1'].count()),\n    'H20 Driverless AI': (responses_df_2021['Q37_A_Part_2'].count()),\n    'Databricks AutoML' : (responses_df_2021['Q37_A_Part_3'].count()),\n    'DataRobot AutoML' : (responses_df_2021['Q37_A_Part_4'].count()),\n    'Amazon Sagemaker Autopilot' : (responses_df_2021['Q37_A_Part_5'].count()),\n    'Azure Automated Machine Learning' : (responses_df_2021['Q37_A_Part_6'].count()),\n    'No / None' : (responses_df_2021['Q37_A_Part_7'].count()),\n    'Other' : (responses_df_2021['Q37_A_OTHER'].count())\n}\n\nq37b_dictionary_of_counts_2021 = {\n    'Google Cloud AutoML' : (responses_df_2021['Q37_B_Part_1'].count()),\n    'H20 Driverless AI': (responses_df_2021['Q37_B_Part_2'].count()),\n    'Databricks AutoML' : (responses_df_2021['Q37_B_Part_3'].count()),\n    'DataRobot AutoML' : (responses_df_2021['Q37_B_Part_4'].count()),\n    'Amazon Sagemaker Autopilot' : (responses_df_2021['Q37_B_Part_5'].count()),\n    'Azure Automated Machine Learning' : (responses_df_2021['Q37_B_Part_6'].count()),\n    'No / None' : (responses_df_2021['Q37_B_Part_7'].count()),\n    'Other' : (responses_df_2021['Q37_B_OTHER'].count())\n}\n\n\nq38a_dictionary_of_counts_2021 = {\n    'Neptune.ai' : (responses_df_2021['Q38_A_Part_1'].count()),\n    'Weights & Biases': (responses_df_2021['Q38_A_Part_2'].count()),\n    'Comet.ml' : (responses_df_2021['Q38_A_Part_3'].count()),\n    'Sacred + Omniboard' : (responses_df_2021['Q38_A_Part_4'].count()),\n    'TensorBoard' : (responses_df_2021['Q38_A_Part_5'].count()),\n    'Guild.ai' : (responses_df_2021['Q38_A_Part_6'].count()),\n    'Polyaxon' : (responses_df_2021['Q38_A_Part_7'].count()),\n    'ClearML' : (responses_df_2021['Q38_A_Part_8'].count()),\n    'Domino Model Monitor' : (responses_df_2021['Q38_A_Part_9'].count()),\n    'MLflow' : (responses_df_2021['Q38_A_Part_10'].count()),\n    'No / None' : (responses_df_2021['Q38_A_Part_11'].count()),\n    'Other' : (responses_df_2021['Q38_A_OTHER'].count())\n}\n\n\nq38b_dictionary_of_counts_2021 = {\n    'Neptune.ai' : (responses_df_2021['Q38_B_Part_1'].count()),\n    'Weights & Biases': (responses_df_2021['Q38_B_Part_2'].count()),\n    'Comet.ml' : (responses_df_2021['Q38_B_Part_3'].count()),\n    'Sacred + Omniboard' : (responses_df_2021['Q38_B_Part_4'].count()),\n    'TensorBoard' : (responses_df_2021['Q38_B_Part_5'].count()),\n    'Guild.ai' : (responses_df_2021['Q38_B_Part_6'].count()),\n    'Polyaxon' : (responses_df_2021['Q38_B_Part_7'].count()),\n    'ClearML' : (responses_df_2021['Q38_B_Part_8'].count()),\n    'Domino Model Monitor' : (responses_df_2021['Q38_B_Part_9'].count()),\n    'MLflow' : (responses_df_2021['Q38_B_Part_10'].count()),\n    'No / None' : (responses_df_2021['Q38_B_Part_11'].count()),\n    'Other' : (responses_df_2021['Q38_B_OTHER'].count())\n}\n\nq39_dictionary_of_counts_2021 = {\n    'Plotly Dash' : (responses_df_2021['Q39_Part_1'].count()),\n    'Streamlit': (responses_df_2021['Q39_Part_2'].count()),\n    'NBViewer' : (responses_df_2021['Q39_Part_3'].count()),\n    'GitHub' : (responses_df_2021['Q39_Part_4'].count()),\n    'Personal Blog' : (responses_df_2021['Q39_Part_5'].count()),\n    'Kaggle' : (responses_df_2021['Q39_Part_6'].count()),\n    'Colab' : (responses_df_2021['Q39_Part_7'].count()),\n    'Shiny' : (responses_df_2021['Q39_Part_8'].count()),\n    'None / I do not share my work publicly' : (responses_df_2021['Q39_Part_9'].count()),\n    'Other' : (responses_df_2021['Q39_OTHER'].count())\n}\n\n\nq40_dictionary_of_counts_2021 = {\n    'Coursera' : (responses_df_2021['Q40_Part_1'].count()),\n    'EdX': (responses_df_2021['Q40_Part_2'].count()),\n    'Kaggle Learn Courses' : (responses_df_2021['Q40_Part_3'].count()),\n    'DataCamp' : (responses_df_2021['Q40_Part_4'].count()),\n    'Fast.ai' : (responses_df_2021['Q40_Part_5'].count()),\n    'Udacity' : (responses_df_2021['Q40_Part_6'].count()),\n    'Udemy' : (responses_df_2021['Q40_Part_7'].count()),\n    'LinkedIn Learning' : (responses_df_2021['Q40_Part_8'].count()),\n    'Cloud-certification programs' : (responses_df_2021['Q40_Part_9'].count()),\n    'University Courses' : (responses_df_2021['Q40_Part_10'].count()),\n    'None' : (responses_df_2021['Q40_Part_11'].count()),\n    'Other' : (responses_df_2021['Q40_OTHER'].count())\n}\n\n\nq42_dictionary_of_counts_2021 = {\n    'Twitter (data science influencers)' : (responses_df_2021['Q42_Part_1'].count()),\n    'Email newsletters (Data Elixir, OReilly Data & AI, etc)': (responses_df_2021['Q42_Part_2'].count()),\n    'Reddit (r/machinelearning, etc)' : (responses_df_2021['Q42_Part_3'].count()),\n    'Kaggle (notebooks, forums, etc)' : (responses_df_2021['Q42_Part_4'].count()),\n    'Course Forums (forums.fast.ai, Coursera forums, etc)' : (responses_df_2021['Q42_Part_5'].count()),\n    'YouTube (Kaggle YouTube, Cloud AI Adventures, etc)' : (responses_df_2021['Q42_Part_6'].count()),\n    'Podcasts (Chai Time Data Science, OReilly Data Show, etc)' : (responses_df_2021['Q42_Part_7'].count()),\n    'Blogs (Towards Data Science, Analytics Vidhya, etc)' : (responses_df_2021['Q42_Part_8'].count()),\n    'Journal Publications (peer-reviewed journals, conference proceedings, etc)' : (responses_df_2021['Q42_Part_9'].count()),\n    'Slack Communities (ods.ai, kagglenoobs, etc)' : (responses_df_2021['Q42_Part_10'].count()),\n    'None' : (responses_df_2021['Q42_Part_11'].count()),\n    'Other' : (responses_df_2021['Q42_OTHER'].count())\n}\n\n# Questions where respondents can select more than one answer choice have been split into multiple columns.\n# These lists delineate every sub-column for every multiple-column question.\n\n\nq7_list_of_columns_2018 = ['Q16_Part_1',\n                      'Q16_Part_2',\n                      'Q16_Part_3',\n                      'Q16_Part_4',\n                      'Q16_Part_5',\n                      'Q16_Part_6',\n                      'Q16_Part_7',\n                      'Q16_Part_8',\n                      'Q16_Part_9',\n                      'Q16_Part_10',\n                      'Q16_Part_11',\n                      'Q16_Part_12']\n\nq9_list_of_columns_2018 = ['Q13_Part_1',\n                      'Q13_Part_2',\n                      'Q13_Part_3',\n                      'Q13_Part_4',\n                      'Q13_Part_5',\n                      'Q13_Part_6',\n                      'Q13_Part_7',\n                      'Q13_Part_8',\n                      'Q13_Part_9',\n                      'Q13_Part_10',\n                      'Q13_Part_11',\n                      'Q13_Part_12']\n\n\nq10_list_of_columns_2018 = ['Q14_Part_1',\n                       'Q14_Part_2',\n                       'Q14_Part_3',\n                       'Q14_Part_4',\n                       'Q14_Part_5',\n                       'Q14_Part_6',\n                       'Q14_Part_7',\n                       'Q14_Part_8',\n                       'Q14_Part_9',\n                       'Q14_Part_10',\n                       'Q14_Part_11']\n\nq14_list_of_columns_2018 = ['Q21_Part_1',\n                            'Q21_Part_2',\n                            'Q21_Part_3',\n                            'Q21_Part_4',\n                            'Q21_Part_5',\n                            'Q21_Part_6',\n                            'Q21_Part_7',\n                            'Q21_Part_8',\n                            'Q21_Part_9',\n                            'Q21_Part_10',\n                            'Q21_Part_11',\n                            'Q21_Part_12']\n\nq16_list_of_columns_2018 = ['Q19_Part_1',\n                       'Q19_Part_2',\n                       'Q19_Part_3',\n                       'Q19_Part_4',\n                       'Q19_Part_5',\n                       'Q19_Part_6',\n                       'Q19_Part_7',\n                       'Q19_Part_8',\n                       'Q19_Part_9',\n                       'Q19_Part_10',\n                       'Q19_Part_11',\n                       'Q19_Part_12']\n\n\n\nq26a_list_of_columns_2018 = ['Q15_Part_1',\n                        'Q15_Part_2',\n                        'Q15_Part_3',\n                        'Q15_Part_4',\n                        'Q15_Part_5',\n                        'Q15_Part_6',\n                        'Q15_Part_7']\n\n\nq29a_list_of_columns_2018 = ['Q29_Part_1',\n                        'Q29_Part_2',\n                        'Q29_Part_3',\n                        'Q29_Part_4',\n                        'Q29_Part_5',\n                        'Q29_Part_6',\n                        'Q29_Part_7',\n                        'Q29_Part_8',\n                        'Q29_Part_9',\n                        'Q29_Part_10',\n                        'Q29_Part_11',\n                        'Q29_Part_12']\n\n\n# Questions where respondents can select more than one answer choice have been split into multiple columns.\n# These lists delineate every sub-column for every multiple-column question.\n\nq7_list_of_columns_2019 = ['Q18_Part_1',\n                      'Q18_Part_2',\n                      'Q18_Part_3',\n                      'Q18_Part_4',\n                      'Q18_Part_5',\n                      'Q18_Part_6',\n                      'Q18_Part_7',\n                      'Q18_Part_8',\n                      'Q18_Part_9',\n                      'Q18_Part_10',\n                      'Q18_Part_11',\n                      'Q18_Part_12']\n\n\nq9_list_of_columns_2019 = ['Q16_Part_1',\n                      'Q16_Part_2',\n                      'Q16_Part_3',\n                      'Q16_Part_4',\n                      'Q16_Part_5',\n                      'Q16_Part_6',\n                      'Q16_Part_7',\n                      'Q16_Part_8',\n                      'Q16_Part_9',\n                      'Q16_Part_10',\n                      'Q16_Part_11',\n                      'Q16_Part_12']\n\n\nq10_list_of_columns_2019 = ['Q17_Part_1',\n                       'Q17_Part_2',\n                       'Q17_Part_3',\n                       'Q17_Part_4',\n                       'Q17_Part_5',\n                       'Q17_Part_6',\n                       'Q17_Part_7',\n                       'Q17_Part_8',\n                       'Q17_Part_9',\n                       'Q17_Part_10',\n                       'Q17_Part_11',\n                       'Q17_Part_12']\n\n\nq12_list_of_columns_2019 = ['Q21_Part_1',\n                            'Q21_Part_2',\n                            'Q21_Part_3',\n                            'Q21_Part_4',\n                            'Q21_Part_5']\n\nq14_list_of_columns_2019 = ['Q20_Part_1',\n                            'Q20_Part_2',\n                            'Q20_Part_3',\n                            'Q20_Part_4',\n                            'Q20_Part_5',\n                            'Q20_Part_6',\n                            'Q20_Part_7',\n                            'Q20_Part_8',\n                            'Q20_Part_9',\n                            'Q20_Part_10',\n                            'Q20_Part_11',\n                            'Q20_Part_12']\n\n\nq16_list_of_columns_2019 = ['Q28_Part_1',\n                       'Q28_Part_2',\n                       'Q28_Part_3',\n                       'Q28_Part_4',\n                       'Q28_Part_5',\n                       'Q28_Part_6',\n                       'Q28_Part_7',\n                       'Q28_Part_8',\n                       'Q28_Part_9',\n                       'Q28_Part_10',\n                       'Q28_Part_11',\n                       'Q28_Part_12']\n\n\nq17_list_of_columns_2019 = ['Q24_Part_1',\n                       'Q24_Part_2',\n                       'Q24_Part_3',\n                       'Q24_Part_4',\n                       'Q24_Part_5',\n                       'Q24_Part_6',\n                       'Q24_Part_7',\n                       'Q24_Part_8',\n                       'Q24_Part_9',\n                       'Q24_Part_10',\n                       'Q24_Part_11',\n                       'Q24_Part_12']\n\nq18_list_of_columns_2019 = ['Q26_Part_1',\n                       'Q26_Part_2',\n                       'Q26_Part_3',\n                       'Q26_Part_4',\n                       'Q26_Part_5',\n                       'Q26_Part_6',\n                       'Q26_Part_7']\n\nq19_list_of_columns_2019 = ['Q27_Part_1',\n                       'Q27_Part_2',\n                       'Q27_Part_3',\n                       'Q27_Part_4',\n                       'Q27_Part_5',\n                       'Q27_Part_6']\n\nq26a_list_of_columns_2019 = ['Q29_Part_1',\n                        'Q29_Part_2',\n                        'Q29_Part_3',\n                        'Q29_Part_4',\n                        'Q29_Part_5',\n                        'Q29_Part_6',\n                        'Q29_Part_7',\n                        'Q29_Part_8',\n                        'Q29_Part_9',\n                        'Q29_Part_10',\n                        'Q29_Part_11',\n                        'Q29_Part_12']\n\nq27a_list_of_columns_2019 = ['Q27_A_Part_1',\n                        'Q27_A_Part_2',\n                        'Q27_A_Part_3',\n                        'Q27_A_Part_4',\n                        'Q27_A_Part_5',\n                        'Q27_A_Part_6',\n                        'Q27_A_Part_7',\n                        'Q27_A_Part_8',\n                        'Q27_A_Part_9',\n                        'Q27_A_Part_10',\n                        'Q27_A_Part_11',\n                        'Q27_A_OTHER']\n\nq29a_list_of_columns_2019 = ['Q34_Part_1',\n                        'Q34_Part_2',\n                        'Q34_Part_3',\n                        'Q34_Part_4',\n                        'Q34_Part_5',\n                        'Q34_Part_6',\n                        'Q34_Part_7',\n                        'Q34_Part_8',\n                        'Q34_Part_9',\n                        'Q34_Part_10',\n                        'Q34_Part_11',\n                        'Q34_Part_12']\n\nq37a_list_of_columns_2019 = ['Q33_Part_1',\n                        'Q33_Part_2',\n                        'Q33_Part_3',\n                        'Q33_Part_4',\n                        'Q33_Part_5',\n                        'Q33_Part_6',\n                        'Q33_Part_7',\n                        'Q33_Part_8',\n                        'Q33_Part_9',\n                        'Q33_Part_10',\n                        'Q33_Part_11',\n                        'Q33_Part_12']\n\n# Questions where respondents can select more than one answer choice have been split into multiple columns.\n# These lists delineate every sub-column for every multiple-column question.\n\nq7_list_of_columns_2020 = ['Q7_Part_1',\n                      'Q7_Part_2',\n                      'Q7_Part_3',\n                      'Q7_Part_4',\n                      'Q7_Part_5',\n                      'Q7_Part_6',\n                      'Q7_Part_7',\n                      'Q7_Part_8',\n                      'Q7_Part_9',\n                      'Q7_Part_10',\n                      'Q7_Part_11',\n                      'Q7_Part_12',\n                      'Q7_OTHER']\n\nq9_list_of_columns_2020 = ['Q9_Part_1',\n                      'Q9_Part_2',\n                      'Q9_Part_3',\n                      'Q9_Part_4',\n                      'Q9_Part_5',\n                      'Q9_Part_6',\n                      'Q9_Part_7',\n                      'Q9_Part_8',\n                      'Q9_Part_9',\n                      'Q9_Part_10',\n                      'Q9_Part_11',\n                      'Q9_OTHER']\n\nq10_list_of_columns_2020 = ['Q10_Part_1',\n                       'Q10_Part_2',\n                       'Q10_Part_3',\n                       'Q10_Part_4',\n                       'Q10_Part_5',\n                       'Q10_Part_6',\n                       'Q10_Part_7',\n                       'Q10_Part_8',\n                       'Q10_Part_9',\n                       'Q10_Part_10',\n                       'Q10_Part_11',\n                       'Q10_Part_12',\n                       'Q10_Part_13',\n                       'Q10_OTHER']\n\nq12_list_of_columns_2020 = ['Q12_Part_1',\n                            'Q12_Part_2',\n                            'Q12_Part_3',\n                            'Q12_OTHER']\n\nq14_list_of_columns_2020 = ['Q14_Part_1',\n                            'Q14_Part_2',\n                            'Q14_Part_3',\n                            'Q14_Part_4',\n                            'Q14_Part_5',\n                            'Q14_Part_6',\n                            'Q14_Part_7',\n                            'Q14_Part_8',\n                            'Q14_Part_9',\n                            'Q14_Part_10',\n                            'Q14_Part_11',\n                            'Q14_OTHER']\n\nq16_list_of_columns_2020 = ['Q16_Part_1',\n                       'Q16_Part_2',\n                       'Q16_Part_3',\n                       'Q16_Part_4',\n                       'Q16_Part_5',\n                       'Q16_Part_6',\n                       'Q16_Part_7',\n                       'Q16_Part_8',\n                       'Q16_Part_9',\n                       'Q16_Part_10',\n                       'Q16_Part_11',\n                       'Q16_Part_12',\n                       'Q16_Part_13',\n                       'Q16_Part_14',\n                       'Q16_Part_15',\n                       'Q16_OTHER']\n\nq17_list_of_columns_2020 = ['Q17_Part_1',\n                       'Q17_Part_2',\n                       'Q17_Part_3',\n                       'Q17_Part_4',\n                       'Q17_Part_5',\n                       'Q17_Part_6',\n                       'Q17_Part_7',\n                       'Q17_Part_8',\n                       'Q17_Part_9',\n                       'Q17_Part_10',\n                       'Q17_Part_11',\n                       'Q17_OTHER']\n\nq18_list_of_columns_2020 = ['Q18_Part_1',\n                       'Q18_Part_2',\n                       'Q18_Part_3',\n                       'Q18_Part_4',\n                       'Q18_Part_5',\n                       'Q18_Part_6',\n                       'Q18_OTHER']\n\nq19_list_of_columns_2020 = ['Q19_Part_1',\n                       'Q19_Part_2',\n                       'Q19_Part_3',\n                       'Q19_Part_4',\n                       'Q19_Part_5',\n                       'Q19_OTHER']\n\nq23_list_of_columns_2020 = ['Q23_Part_1',\n                       'Q23_Part_2',\n                       'Q23_Part_3',\n                       'Q23_Part_4',\n                       'Q23_Part_5',\n                       'Q23_Part_6',\n                       'Q23_Part_7',\n                       'Q23_OTHER']\n\nq26a_list_of_columns_2020 = ['Q26_A_Part_1',\n                        'Q26_A_Part_2',\n                        'Q26_A_Part_3',\n                        'Q26_A_Part_4',\n                        'Q26_A_Part_5',\n                        'Q26_A_Part_6',\n                        'Q26_A_Part_7',\n                        'Q26_A_Part_8',\n                        'Q26_A_Part_9',\n                        'Q26_A_Part_10',\n                        'Q26_A_Part_11',\n                        'Q26_A_OTHER']\n\nq26b_list_of_columns_2020 = ['Q26_B_Part_1',\n                        'Q26_B_Part_2',\n                        'Q26_B_Part_3',\n                        'Q26_B_Part_4',\n                        'Q26_B_Part_5',\n                        'Q26_B_Part_6',\n                        'Q26_B_Part_7',\n                        'Q26_B_Part_8',\n                        'Q26_B_Part_9',\n                        'Q26_B_Part_10',\n                        'Q26_B_Part_11',\n                        'Q26_B_OTHER']\n\nq27a_list_of_columns_2020 = ['Q27_A_Part_1',\n                        'Q27_A_Part_2',\n                        'Q27_A_Part_3',\n                        'Q27_A_Part_4',\n                        'Q27_A_Part_5',\n                        'Q27_A_Part_6',\n                        'Q27_A_Part_7',\n                        'Q27_A_Part_8',\n                        'Q27_A_Part_9',\n                        'Q27_A_Part_10',\n                        'Q27_A_Part_11',\n                        'Q27_A_OTHER']\n\nq27b_dictionary_of_counts_2020 = ['Q27_B_Part_1',\n                             'Q27_B_Part_2',\n                             'Q27_B_Part_3',\n                             'Q27_B_Part_4',\n                             'Q27_B_Part_5',\n                             'Q27_B_Part_6',\n                             'Q27_B_Part_7',\n                             'Q27_B_Part_8',\n                             'Q27_B_Part_9',\n                             'Q27_B_Part_10',\n                             'Q27_B_Part_11',\n                             'Q27_B_OTHER']\n\nq28a_list_of_columns_2020 = ['Q28_A_Part_1',\n                        'Q28_A_Part_2',\n                        'Q28_A_Part_3',\n                        'Q28_A_Part_4',\n                        'Q28_A_Part_5',\n                        'Q28_A_Part_6',\n                        'Q28_A_Part_7',\n                        'Q28_A_Part_8',\n                        'Q28_A_Part_9',\n                        'Q28_A_Part_10',\n                        'Q28_A_OTHER']\n\nq28b_list_of_columns_2020 = ['Q28_B_Part_1',\n                        'Q28_B_Part_2',\n                        'Q28_B_Part_3',\n                        'Q28_B_Part_4',\n                        'Q28_B_Part_5',\n                        'Q28_B_Part_6',\n                        'Q28_B_Part_7',\n                        'Q28_B_Part_8',\n                        'Q28_B_Part_9',\n                        'Q28_B_Part_10',\n                        'Q28_B_OTHER']\n\nq29a_list_of_columns_2020 = ['Q29_A_Part_1',\n                        'Q29_A_Part_2',\n                        'Q29_A_Part_3',\n                        'Q29_A_Part_4',\n                        'Q29_A_Part_5',\n                        'Q29_A_Part_6',\n                        'Q29_A_Part_7',\n                        'Q29_A_Part_8',\n                        'Q29_A_Part_9',\n                        'Q29_A_Part_10',\n                        'Q29_A_Part_11',\n                        'Q29_A_Part_12',\n                        'Q29_A_Part_13',\n                        'Q29_A_Part_14',\n                        'Q29_A_Part_15',\n                        'Q29_A_Part_16',\n                        'Q29_A_Part_17',\n                        'Q29_A_OTHER']\n\nq29b_list_of_columns_2020 = ['Q29_B_Part_1',\n                        'Q29_B_Part_2',\n                        'Q29_B_Part_3',\n                        'Q29_B_Part_4',\n                        'Q29_B_Part_5',\n                        'Q29_B_Part_6',\n                        'Q29_B_Part_7',\n                        'Q29_B_Part_8',\n                        'Q29_B_Part_9',\n                        'Q29_B_Part_10',\n                        'Q29_B_Part_11',\n                        'Q29_B_Part_12',\n                        'Q29_B_Part_13',\n                        'Q29_B_Part_14',\n                        'Q29_B_Part_15',\n                        'Q29_B_Part_16',\n                        'Q29_B_Part_17',\n                        'Q29_B_OTHER']\n\nq31a_list_of_columns_2020 = ['Q31_A_Part_1',\n                        'Q31_A_Part_2',\n                        'Q31_A_Part_3',\n                        'Q31_A_Part_4',\n                        'Q31_A_Part_5',\n                        'Q31_A_Part_6',\n                        'Q31_A_Part_7',\n                        'Q31_A_Part_8',\n                        'Q31_A_Part_9',\n                        'Q31_A_Part_10',\n                        'Q31_A_Part_11',\n                        'Q31_A_Part_12',\n                        'Q31_A_Part_13',\n                        'Q31_A_Part_14',\n                        'Q31_A_OTHER']\n\nq31b_list_of_columns_2020 = ['Q31_B_Part_1',\n                        'Q31_B_Part_2',\n                        'Q31_B_Part_3',\n                        'Q31_B_Part_4',\n                        'Q31_B_Part_5',\n                        'Q31_B_Part_6',\n                        'Q31_B_Part_7',\n                        'Q31_B_Part_8',\n                        'Q31_B_Part_9',\n                        'Q31_B_Part_10',\n                        'Q31_B_Part_11',\n                        'Q31_B_Part_12',\n                        'Q31_B_Part_13',\n                        'Q31_B_Part_14',\n                        'Q31_B_OTHER']\n\nq33a_list_of_columns_2020 = ['Q33_A_Part_1',\n                        'Q33_A_Part_2',\n                        'Q33_A_Part_3',\n                        'Q33_A_Part_4',\n                        'Q33_A_Part_5',\n                        'Q33_A_Part_6',\n                        'Q33_A_Part_7',\n                        'Q33_A_OTHER']\n\nq33b_list_of_columns_2020 = ['Q33_B_Part_1',\n                        'Q33_B_Part_2',\n                        'Q33_B_Part_3',\n                        'Q33_B_Part_4',\n                        'Q33_B_Part_5',\n                        'Q33_B_Part_6',\n                        'Q33_B_Part_7',\n                        'Q33_B_OTHER']\n\nq34a_list_of_columns_2020 = ['Q34_A_Part_1',\n                        'Q34_A_Part_2',\n                        'Q34_A_Part_3',\n                        'Q34_A_Part_4',\n                        'Q34_A_Part_5',\n                        'Q34_A_Part_6',\n                        'Q34_A_Part_7',\n                        'Q34_A_Part_8',\n                        'Q34_A_Part_9',\n                        'Q34_A_Part_10',\n                        'Q34_A_Part_11',\n                        'Q34_A_OTHER']\n\nq34b_list_of_columns_2020 = ['Q34_B_Part_1',\n                        'Q34_B_Part_2',\n                        'Q34_B_Part_3',\n                        'Q34_B_Part_4',\n                        'Q34_B_Part_5',\n                        'Q34_B_Part_6',\n                        'Q34_B_Part_7',\n                        'Q34_B_Part_8',\n                        'Q34_B_Part_9',\n                        'Q34_B_Part_10',\n                        'Q34_B_Part_11',\n                        'Q34_B_OTHER']\n\n\nq35a_list_of_columns_2020 = ['Q35_A_Part_1',\n                        'Q35_A_Part_2',\n                        'Q35_A_Part_3',\n                        'Q35_A_Part_4',\n                        'Q35_A_Part_5',\n                        'Q35_A_Part_6',\n                        'Q35_A_Part_7',\n                        'Q35_A_Part_8',\n                        'Q35_A_Part_9',\n                        'Q35_A_Part_10',\n                        'Q35_A_OTHER']\n\nq35b_list_of_columns_2020 = ['Q35_B_Part_1',\n                        'Q35_B_Part_2',\n                        'Q35_B_Part_3',\n                        'Q35_B_Part_4',\n                        'Q35_B_Part_5',\n                        'Q35_B_Part_6',\n                        'Q35_B_Part_7',\n                        'Q35_B_Part_8',\n                        'Q35_B_Part_9',\n                        'Q35_B_Part_10',\n                        'Q35_B_OTHER']\n\nq36_list_of_columns_2020 = ['Q36_Part_1',\n                       'Q36_Part_2',\n                       'Q36_Part_3',\n                       'Q36_Part_4',\n                       'Q36_Part_5',\n                       'Q36_Part_6',\n                       'Q36_Part_7',\n                       'Q36_Part_8',\n                       'Q36_Part_9',\n                       'Q36_OTHER']\n\nq37_list_of_columns_2020 = ['Q37_Part_1',\n                       'Q37_Part_2',\n                       'Q37_Part_3',\n                       'Q37_Part_4',\n                       'Q37_Part_5',\n                       'Q37_Part_6',\n                       'Q37_Part_7',\n                       'Q37_Part_8',\n                       'Q37_Part_9',\n                       'Q37_Part_10',\n                       'Q37_Part_11',\n                       'Q37_OTHER']\n\nq39_list_of_columns_2020 = ['Q39_Part_1',\n                       'Q39_Part_2',\n                       'Q39_Part_3',\n                       'Q39_Part_4',\n                       'Q39_Part_5',\n                       'Q39_Part_6',\n                       'Q39_Part_7',\n                       'Q39_Part_8',\n                       'Q39_Part_9',\n                       'Q39_Part_10',\n                       'Q39_Part_11',\n                       'Q39_OTHER']\n\n# Questions where respondents can select more than one answer choice have been split into multiple columns.\n# These lists delineate every sub-column for every multiple-column question.\n\nq7_list_of_columns_2021 = ['Q7_Part_1',\n                      'Q7_Part_2',\n                      'Q7_Part_3',\n                      'Q7_Part_4',\n                      'Q7_Part_5',\n                      'Q7_Part_6',\n                      'Q7_Part_7',\n                      'Q7_Part_8',\n                      'Q7_Part_9',\n                      'Q7_Part_10',\n                      'Q7_Part_11',\n                      'Q7_Part_12',\n                      'Q7_OTHER']\n\nq9_list_of_columns_2021 = ['Q9_Part_1',\n                      'Q9_Part_2',\n                      'Q9_Part_3',\n                      'Q9_Part_4',\n                      'Q9_Part_5',\n                      'Q9_Part_6',\n                      'Q9_Part_7',\n                      'Q9_Part_8',\n                      'Q9_Part_9',\n                      'Q9_Part_10',\n                      'Q9_Part_11',\n                      'Q9_Part_12',\n                      'Q9_OTHER']\n\nq10_list_of_columns_2021 = ['Q10_Part_1',\n                       'Q10_Part_2',\n                       'Q10_Part_3',\n                       'Q10_Part_4',\n                       'Q10_Part_5',\n                       'Q10_Part_6',\n                       'Q10_Part_7',\n                       'Q10_Part_8',\n                       'Q10_Part_9',\n                       'Q10_Part_10',\n                       'Q10_Part_11',\n                       'Q10_Part_12',\n                       'Q10_Part_13',\n                       'Q10_Part_14',\n                       'Q10_Part_15',\n                       'Q10_Part_16',\n                       'Q10_OTHER']\n\nq12_list_of_columns_2021 = ['Q12_Part_1',\n                            'Q12_Part_2',\n                            'Q12_Part_3',\n                            'Q12_Part_4',\n                            'Q12_Part_5',\n                            'Q12_OTHER']\n\nq14_list_of_columns_2021 = ['Q14_Part_1',\n                            'Q14_Part_2',\n                            'Q14_Part_3',\n                            'Q14_Part_4',\n                            'Q14_Part_5',\n                            'Q14_Part_6',\n                            'Q14_Part_7',\n                            'Q14_Part_8',\n                            'Q14_Part_9',\n                            'Q14_Part_10',\n                            'Q14_Part_11',\n                            'Q14_OTHER']\n\nq16_list_of_columns_2021 = ['Q16_Part_1',\n                       'Q16_Part_2',\n                       'Q16_Part_3',\n                       'Q16_Part_4',\n                       'Q16_Part_5',\n                       'Q16_Part_6',\n                       'Q16_Part_7',\n                       'Q16_Part_8',\n                       'Q16_Part_9',\n                       'Q16_Part_10',\n                       'Q16_Part_11',\n                       'Q16_Part_12',\n                       'Q16_Part_13',\n                       'Q16_Part_14',\n                       'Q16_Part_15',\n                       'Q16_Part_16',\n                       'Q16_Part_17',\n                       'Q16_OTHER']\n\nq17_list_of_columns_2021 = ['Q17_Part_1',\n                       'Q17_Part_2',\n                       'Q17_Part_3',\n                       'Q17_Part_4',\n                       'Q17_Part_5',\n                       'Q17_Part_6',\n                       'Q17_Part_7',\n                       'Q17_Part_8',\n                       'Q17_Part_9',\n                       'Q17_Part_10',\n                       'Q17_Part_11',\n                       'Q17_OTHER']\n\nq18_list_of_columns_2021 = ['Q18_Part_1',\n                       'Q18_Part_2',\n                       'Q18_Part_3',\n                       'Q18_Part_4',\n                       'Q18_Part_5',\n                       'Q18_Part_6',\n                       'Q18_OTHER']\n\nq19_list_of_columns_2021 = ['Q19_Part_1',\n                       'Q19_Part_2',\n                       'Q19_Part_3',\n                       'Q19_Part_4',\n                       'Q19_Part_5',\n                       'Q19_OTHER']\n\nq24_list_of_columns_2021 = ['Q24_Part_1',\n                       'Q24_Part_2',\n                       'Q24_Part_3',\n                       'Q24_Part_4',\n                       'Q24_Part_5',\n                       'Q24_Part_6',\n                       'Q24_Part_7',\n                       'Q24_OTHER']\n\nq27a_list_of_columns_2021 = ['Q27_A_Part_1',\n                        'Q27_A_Part_2',\n                        'Q27_A_Part_3',\n                        'Q27_A_Part_4',\n                        'Q27_A_Part_5',\n                        'Q27_A_Part_6',\n                        'Q27_A_Part_7',\n                        'Q27_A_Part_8',\n                        'Q27_A_Part_9',\n                        'Q27_A_Part_10',\n                        'Q27_A_Part_11',\n                        'Q27_A_OTHER']\n\nq27b_list_of_columns_2021 = ['Q27_B_Part_1',\n                        'Q27_B_Part_2',\n                        'Q27_B_Part_3',\n                        'Q27_B_Part_4',\n                        'Q27_B_Part_5',\n                        'Q27_B_Part_6',\n                        'Q27_B_Part_7',\n                        'Q27_B_Part_8',\n                        'Q27_B_Part_9',\n                        'Q27_B_Part_10',\n                        'Q27_B_Part_11',\n                        'Q27_B_OTHER']\n\nq29a_list_of_columns_2021 = ['Q29_A_Part_1',\n                        'Q29_A_Part_2',\n                        'Q29_A_Part_3',\n                        'Q29_A_Part_4',\n                        'Q29_A_OTHER']\n\nq29b_list_of_columns_2021 = ['Q29_B_Part_1',\n                             'Q29_B_Part_2',\n                             'Q29_B_Part_3',\n                             'Q29_B_Part_4',\n                             'Q29_B_OTHER']\n\nq30a_list_of_columns_2021 = ['Q30_A_Part_1',\n                        'Q30_A_Part_2',\n                        'Q30_A_Part_3',\n                        'Q30_A_Part_4',\n                        'Q30_A_Part_5',\n                        'Q30_A_Part_6',\n                        'Q30_A_Part_7',\n                        'Q30_A_OTHER']\n\nq30b_list_of_columns_2021 = ['Q30_B_Part_1',\n                        'Q30_B_Part_2',\n                        'Q30_B_Part_3',\n                        'Q30_B_Part_4',\n                        'Q30_B_Part_5',\n                        'Q30_B_Part_6',\n                        'Q30_B_Part_7',\n                        'Q30_B_OTHER']\n\nq31a_list_of_columns_2021 = ['Q31_A_Part_1',\n                        'Q31_A_Part_2',\n                        'Q31_A_Part_3',\n                        'Q31_A_Part_4',\n                        'Q31_A_Part_5',\n                        'Q31_A_Part_6',\n                        'Q31_A_Part_7',\n                        'Q31_A_Part_8',\n                        'Q31_A_Part_9',\n                        'Q31_A_OTHER']\n\nq31b_list_of_columns_2021 = ['Q31_B_Part_1',\n                        'Q31_B_Part_2',\n                        'Q31_B_Part_3',\n                        'Q31_B_Part_4',\n                        'Q31_B_Part_5',\n                        'Q31_B_Part_6',\n                        'Q31_B_Part_7',\n                        'Q31_B_Part_8',\n                        'Q31_B_Part_9',\n                        'Q31_B_OTHER']\n\nq32a_list_of_columns_2021 = ['Q32_A_Part_1',\n                        'Q32_A_Part_2',\n                        'Q32_A_Part_3',\n                        'Q32_A_Part_4',\n                        'Q32_A_Part_5',\n                        'Q32_A_Part_6',\n                        'Q32_A_Part_7',\n                        'Q32_A_Part_8',\n                        'Q32_A_Part_9',\n                        'Q32_A_Part_10',\n                        'Q32_A_Part_11',\n                        'Q32_A_Part_12',\n                        'Q32_A_Part_13',\n                        'Q32_A_Part_14',\n                        'Q32_A_Part_15',\n                        'Q32_A_Part_16',\n                        'Q32_A_Part_17',\n                        'Q32_A_Part_18',\n                        'Q32_A_Part_19',\n                        'Q32_A_Part_20',\n                        'Q32_A_OTHER']\n\nq32b_list_of_columns_2021 = ['Q32_B_Part_1',\n                        'Q32_B_Part_2',\n                        'Q32_B_Part_3',\n                        'Q32_B_Part_4',\n                        'Q32_B_Part_5',\n                        'Q32_B_Part_6',\n                        'Q32_B_Part_7',\n                        'Q32_B_Part_8',\n                        'Q32_B_Part_9',\n                        'Q32_B_Part_10',\n                        'Q32_B_Part_11',\n                        'Q32_B_Part_12',\n                        'Q32_B_Part_13',\n                        'Q32_B_Part_14',\n                        'Q32_B_Part_15',\n                        'Q32_B_Part_16',\n                        'Q32_B_Part_17',\n                        'Q32_B_Part_18',\n                        'Q32_B_Part_19',\n                        'Q32_B_Part_20',\n                        'Q32_B_OTHER']\n\nq34a_list_of_columns_2021 = ['Q34_A_Part_1',\n                        'Q34_A_Part_2',\n                        'Q34_A_Part_3',\n                        'Q34_A_Part_4',\n                        'Q34_A_Part_5',\n                        'Q34_A_Part_6',\n                        'Q34_A_Part_7',\n                        'Q34_A_Part_8',\n                        'Q34_A_Part_9',\n                        'Q34_A_Part_10',\n                        'Q34_A_Part_11',\n                        'Q34_A_Part_12',\n                        'Q34_A_Part_13',\n                        'Q34_A_Part_14',\n                        'Q34_A_Part_15',\n                        'Q34_A_Part_16',\n                        'Q34_A_OTHER']\n\nq34b_list_of_columns_2021 = ['Q34_B_Part_1',\n                        'Q34_B_Part_2',\n                        'Q34_B_Part_3',\n                        'Q34_B_Part_4',\n                        'Q34_B_Part_5',\n                        'Q34_B_Part_6',\n                        'Q34_B_Part_7',\n                        'Q34_B_Part_8',\n                        'Q34_B_Part_9',\n                        'Q34_B_Part_10',\n                        'Q34_B_Part_11',\n                        'Q34_B_Part_12',\n                        'Q34_B_Part_13',\n                        'Q34_B_Part_14',\n                        'Q34_B_Part_15',\n                        'Q34_B_Part_16',\n                        'Q34_B_OTHER']\n\nq36a_list_of_columns_2021 = ['Q36_A_Part_1',\n                        'Q36_A_Part_2',\n                        'Q36_A_Part_3',\n                        'Q36_A_Part_4',\n                        'Q36_A_Part_5',\n                        'Q36_A_Part_6',\n                        'Q36_A_Part_7',\n                        'Q36_A_OTHER']\n\nq36b_list_of_columns_2021 = ['Q36_B_Part_1',\n                        'Q36_B_Part_2',\n                        'Q36_B_Part_3',\n                        'Q36_B_Part_4',\n                        'Q36_B_Part_5',\n                        'Q36_B_Part_6',\n                        'Q36_B_Part_7',\n                        'Q36_B_OTHER']\n\n\nq37a_list_of_columns_2021 = ['Q37_A_Part_1',\n                        'Q37_A_Part_2',\n                        'Q37_A_Part_3',\n                        'Q37_A_Part_4',\n                        'Q37_A_Part_5',\n                        'Q37_A_Part_6',\n                        'Q37_A_Part_7',\n                        'Q37_A_OTHER']\n\nq37b_list_of_columns_2021 = ['Q37_B_Part_1',\n                        'Q37_B_Part_2',\n                        'Q37_B_Part_3',\n                        'Q37_B_Part_4',\n                        'Q37_B_Part_5',\n                        'Q37_B_Part_6',\n                        'Q37_B_Part_7',\n                        'Q37_B_OTHER']\n\nq38a_list_of_columns_2021 = ['Q38_A_Part_1',\n                       'Q38_A_Part_2',\n                       'Q38_A_Part_3',\n                       'Q38_A_Part_4',\n                       'Q38_A_Part_5',\n                       'Q38_A_Part_6',\n                       'Q38_A_Part_7',\n                       'Q38_A_Part_8',\n                       'Q38_A_Part_9',\n                       'Q38_A_Part_10',\n                       'Q38_A_Part_11',\n                       'Q38_A_OTHER']\n\nq38b_list_of_columns_2021 = ['Q38_B_Part_1',\n                       'Q38_B_Part_2',\n                       'Q38_B_Part_3',\n                       'Q38_B_Part_4',\n                       'Q38_B_Part_5',\n                       'Q38_B_Part_6',\n                       'Q38_B_Part_7',\n                       'Q38_B_Part_8',\n                       'Q38_B_Part_9',\n                       'Q38_B_Part_10',\n                       'Q38_B_Part_11',\n                       'Q38_A_OTHER']\n\nq39_list_of_columns_2021 = ['Q37_Part_1',\n                       'Q37_Part_2',\n                       'Q37_Part_3',\n                       'Q37_Part_4',\n                       'Q37_Part_5',\n                       'Q37_Part_6',\n                       'Q37_Part_7',\n                       'Q37_Part_8',\n                       'Q37_Part_9',\n                       'Q37_OTHER']\n\nq39_list_of_columns_2021 = ['Q39_Part_1',\n                       'Q39_Part_2',\n                       'Q39_Part_3',\n                       'Q39_Part_4',\n                       'Q39_Part_5',\n                       'Q39_Part_6',\n                       'Q39_Part_7',\n                       'Q39_Part_8',\n                       'Q39_Part_9',\n                       'Q39_OTHER']\n\nq40_list_of_columns_2021 = ['Q40_Part_1',\n                       'Q40_Part_2',\n                       'Q40_Part_3',\n                       'Q40_Part_4',\n                       'Q40_Part_5',\n                       'Q40_Part_6',\n                       'Q40_Part_7',\n                       'Q40_Part_8',\n                       'Q40_Part_9',\n                       'Q40_Part_10',\n                       'Q40_Part_11',\n                       'Q40_OTHER']\n\nq42_list_of_columns_2021 = ['Q42_Part_1',\n                       'Q42_Part_2',\n                       'Q42_Part_3',\n                       'Q42_Part_4',\n                       'Q42_Part_5',\n                       'Q42_Part_6',\n                       'Q42_Part_7',\n                       'Q42_Part_8',\n                       'Q42_Part_9',\n                       'Q42_Part_10',\n                       'Q42_Part_11',\n                       'Q39_OTHER']","metadata":{"_kg_hide-input":true,"id":"XJfeXQtPHsw8","papermill":{"duration":0.852458,"end_time":"2021-10-13T23:01:09.0604","exception":false,"start_time":"2021-10-13T23:01:08.207942","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:01.597075Z","iopub.execute_input":"2022-07-07T16:18:01.597307Z","iopub.status.idle":"2022-07-07T16:18:02.331534Z","shell.execute_reply.started":"2022-07-07T16:18:01.597281Z","shell.execute_reply":"2022-07-07T16:18:02.330597Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"*Step 3: Create a map of response counts and response percentages*","metadata":{"id":"IrVfSHIvHsxC","papermill":{"duration":0.070678,"end_time":"2021-10-13T23:01:09.202737","exception":false,"start_time":"2021-10-13T23:01:09.132059","status":"completed"},"tags":[]}},{"cell_type":"code","source":"responses_per_country_df = create_dataframe_of_counts(survey_df_2020,'Q3','country','# of respondents',return_percentages=False)\npercentages_per_country_df = create_dataframe_of_counts(survey_df_2020,'Q3','country','% of respondents',return_percentages=True)\n\nplotly_choropleth_map(responses_per_country_df, \n                       '# of respondents', \n                       'Total number of responses per country in 2021',\n                        max_value = 200)\nplotly_choropleth_map(percentages_per_country_df, \n                       '% of respondents', \n                       'Percentage of total responses for most common countries in 2021',\n                        max_value = 5)\nprint('Note that countries with less than 50 responses were replaced with the country name \"other\" (which does not show up on this map)')","metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_kg_hide-input":true,"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","id":"4hqc1xeNHsxC","outputId":"f8cd64bd-40a5-49e1-a954-4ae8c142ad0e","papermill":{"duration":1.219875,"end_time":"2021-10-13T23:01:10.493846","exception":false,"start_time":"2021-10-13T23:01:09.273971","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:02.332670Z","iopub.execute_input":"2022-07-07T16:18:02.332934Z","iopub.status.idle":"2022-07-07T16:18:02.482326Z","shell.execute_reply.started":"2022-07-07T16:18:02.332904Z","shell.execute_reply":"2022-07-07T16:18:02.481344Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"*Step 4: Create bar graphs for every question from the 2020 Kaggle DS & ML Survey*","metadata":{"id":"zta4dP0LHsxG","papermill":{"duration":0.084614,"end_time":"2021-10-13T23:01:10.664239","exception":false,"start_time":"2021-10-13T23:01:10.579625","status":"completed"},"tags":[]}},{"cell_type":"code","source":"question_name = 'Q1'\npercentages = count_then_return_percent(responses_df_2021,question_name).sort_index()\ntitle_for_chart = 'Age Distributions on Kaggle'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"H-nJdeNFHsxG","outputId":"11fb3962-4266-43c6-c15a-91545a33b2e9","papermill":{"duration":0.212964,"end_time":"2021-10-13T23:01:10.963198","exception":false,"start_time":"2021-10-13T23:01:10.750234","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:02.483533Z","iopub.execute_input":"2022-07-07T16:18:02.483752Z","iopub.status.idle":"2022-07-07T16:18:02.569434Z","shell.execute_reply.started":"2022-07-07T16:18:02.483728Z","shell.execute_reply":"2022-07-07T16:18:02.568484Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q1'\n#percentages_2017 = count_then_return_percent(responses_df_2017,'Age').sort_index() # data needs to be binned first\npercentages_2018 = count_then_return_percent(responses_df_2018,'Q2').sort_index()\npercentages_2019 = count_then_return_percent(responses_df_2019,question_name).sort_index()\npercentages_2020 = count_then_return_percent(responses_df_2020,question_name).sort_index()\npercentages_2021 = count_then_return_percent(responses_df_2021,question_name).sort_index()\n\ntitle_for_chart = 'Age Distributions on Kaggle from 2018-2021'\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    #go.Bar(name='2017 Kaggle Survey', x=pd.Series(percentages_2017.index), y=pd.Series(percentages_2017)),\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(percentages_2018.index), y=pd.Series(percentages_2018)),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(percentages_2019.index), y=pd.Series(percentages_2019)),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(percentages_2020.index), y=pd.Series(percentages_2020)),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(percentages_2021.index), y=pd.Series(percentages_2021))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.130094,"end_time":"2021-10-13T23:01:11.185163","exception":false,"start_time":"2021-10-13T23:01:11.055069","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:02.570504Z","iopub.execute_input":"2022-07-07T16:18:02.570711Z","iopub.status.idle":"2022-07-07T16:18:02.606473Z","shell.execute_reply.started":"2022-07-07T16:18:02.570688Z","shell.execute_reply":"2022-07-07T16:18:02.605512Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q2'\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name).iloc[::-1]\ntitle_for_chart = 'Gender Distributions on Kaggle'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"u7tPGKMdHsxK","papermill":{"duration":0.185157,"end_time":"2021-10-13T23:01:11.469033","exception":false,"start_time":"2021-10-13T23:01:11.283876","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:02.607605Z","iopub.execute_input":"2022-07-07T16:18:02.607820Z","iopub.status.idle":"2022-07-07T16:18:02.693292Z","shell.execute_reply.started":"2022-07-07T16:18:02.607796Z","shell.execute_reply":"2022-07-07T16:18:02.692432Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"responses_df_2017['GenderSelect'].replace(['Male'], 'Man',inplace=True)\nresponses_df_2017['GenderSelect'].replace(['Female'], 'Woman',inplace=True)\nresponses_df_2017['GenderSelect'].replace(['A different identity','Non-binary, genderqueer, or gender non-conforming'], 'Prefer to self-describe',inplace=True)\nresponses_df_2017['GenderSelect'].replace(['Non-binary, genderqueer, or gender non-conforming'], 'Nonbinary',inplace=True)\nresponses_df_2018['Q1'].replace(['Male'], 'Man',inplace=True)\nresponses_df_2018['Q1'].replace(['Female'], 'Woman',inplace=True)\nresponses_df_2019['Q2'].replace(['Male'], 'Man',inplace=True)\nresponses_df_2019['Q2'].replace(['Female'], 'Woman',inplace=True)\n\nresponses_df_2017['GenderSelect'].replace(['Nonbinary','Prefer not to say'], 'Prefer to self-describe',inplace=True)\nresponses_df_2018['Q1'].replace(['Nonbinary','Prefer not to say'], 'Prefer to self-describe',inplace=True)\nresponses_df_2019['Q2'].replace(['Nonbinary','Prefer not to say'], 'Prefer to self-describe',inplace=True)\nresponses_df_2020['Q2'].replace(['Nonbinary','Prefer not to say'], 'Prefer to self-describe',inplace=True)\nresponses_df_2021['Q2'].replace(['Nonbinary','Prefer not to say'], 'Prefer to self-describe',inplace=True)\n\n\nsorted_percentages_2017 = count_then_return_percent(responses_df_2017,'GenderSelect').iloc[::-1]\nsorted_percentages_2018 = count_then_return_percent(responses_df_2018,'Q1').iloc[::-1]\nsorted_percentages_2019 = count_then_return_percent(responses_df_2019,'Q2').iloc[::-1]\nsorted_percentages_2020 = count_then_return_percent(responses_df_2020,'Q2').iloc[::-1]\nsorted_percentages_2021 = count_then_return_percent(responses_df_2021,'Q2').iloc[::-1]\n\ntitle_for_chart = 'Gender Distributions on Kaggle from 2017 to 2021'\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2017 Kaggle Survey', x=pd.Series(sorted_percentages_2017.index), y=pd.Series(sorted_percentages_2017)),\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(sorted_percentages_2018.index), y=pd.Series(sorted_percentages_2018)),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(sorted_percentages_2019.index), y=pd.Series(sorted_percentages_2019)),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(sorted_percentages_2020.index), y=pd.Series(sorted_percentages_2020)),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(sorted_percentages_2021.index), y=pd.Series(sorted_percentages_2021))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.161795,"end_time":"2021-10-13T23:01:11.735181","exception":false,"start_time":"2021-10-13T23:01:11.573386","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:02.694598Z","iopub.execute_input":"2022-07-07T16:18:02.694821Z","iopub.status.idle":"2022-07-07T16:18:02.750764Z","shell.execute_reply.started":"2022-07-07T16:18:02.694796Z","shell.execute_reply":"2022-07-07T16:18:02.749923Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"responses_df_2021_backup = responses_df_2021.copy()\nresponses_df_2017['Country'].replace(['United States'], 'United States of America',inplace=True)\nresponses_df_2017['Country'].replace([\"People 's Republic of China\"], 'China',inplace=True)\nresponses_df_2017['Country'].replace([\"United Kingdom\"], 'United Kingdom of Great Britain and Northern Ireland',inplace=True)\n\nsubset_of_countries = ['India',\n                       'United States of America',\n                       'Brazil',\n                       'Russia',\n                       'United Kingdom of Great Britain and Northern Ireland',\n                       'France',\n                       'Nigeria',\n                       'Turkey',\n                       'Pakistan',\n                       'Japan']\n\nresponses_df_2017.Country[~responses_df_2017.Country.isin(subset_of_countries)] = \"Other\"\nresponses_df_2018.Q3[~responses_df_2018.Q3.isin(subset_of_countries)] = \"Other\"\nresponses_df_2019.Q3[~responses_df_2019.Q3.isin(subset_of_countries)] = \"Other\"\nresponses_df_2020.Q3[~responses_df_2020.Q3.isin(subset_of_countries)] = \"Other\"\nresponses_df_2021.Q3[~responses_df_2021.Q3.isin(subset_of_countries)] = \"Other\"","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.158875,"end_time":"2021-10-13T23:01:12.007476","exception":false,"start_time":"2021-10-13T23:01:11.848601","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:02.751961Z","iopub.execute_input":"2022-07-07T16:18:02.752181Z","iopub.status.idle":"2022-07-07T16:18:02.794946Z","shell.execute_reply.started":"2022-07-07T16:18:02.752156Z","shell.execute_reply":"2022-07-07T16:18:02.794177Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q3'\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name).iloc[::-1]#[55:]\ntitle_for_chart = 'Most Common Nationalities'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'v'\n  \nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"_kg_hide-output":false,"id":"1NJDAD8vHsxM","papermill":{"duration":0.19482,"end_time":"2021-10-13T23:01:12.314804","exception":false,"start_time":"2021-10-13T23:01:12.119984","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:02.796333Z","iopub.execute_input":"2022-07-07T16:18:02.796768Z","iopub.status.idle":"2022-07-07T16:18:02.880498Z","shell.execute_reply.started":"2022-07-07T16:18:02.796739Z","shell.execute_reply":"2022-07-07T16:18:02.879511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sorted_percentages_2017 = count_then_return_percent(responses_df_2017,'Country').iloc[::-1]\nsorted_percentages_2018 = count_then_return_percent(responses_df_2018,'Q3').iloc[::-1]\nsorted_percentages_2019 = count_then_return_percent(responses_df_2019,'Q3').iloc[::-1]\nsorted_percentages_2020 = count_then_return_percent(responses_df_2020,'Q3').iloc[::-1]\nsorted_percentages_2021 = count_then_return_percent(responses_df_2021,'Q3').iloc[::-1]\n\ntitle_for_chart = 'Most Common Nationalities on Kaggle from 2017 to 2021'\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2017 Kaggle Survey', x=pd.Series(sorted_percentages_2017.index), y=pd.Series(sorted_percentages_2017)),\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(sorted_percentages_2018.index), y=pd.Series(sorted_percentages_2018)),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(sorted_percentages_2019.index), y=pd.Series(sorted_percentages_2019)),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(sorted_percentages_2020.index), y=pd.Series(sorted_percentages_2020)),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(sorted_percentages_2021.index), y=pd.Series(sorted_percentages_2021))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()\nresponses_df_2021 = responses_df_2021_backup.copy()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.172713,"end_time":"2021-10-13T23:01:12.605845","exception":false,"start_time":"2021-10-13T23:01:12.433132","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:02.881915Z","iopub.execute_input":"2022-07-07T16:18:02.882468Z","iopub.status.idle":"2022-07-07T16:18:02.926968Z","shell.execute_reply.started":"2022-07-07T16:18:02.882410Z","shell.execute_reply":"2022-07-07T16:18:02.926404Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"responses_df_2021['Q4'].replace([\"Bachelorâs degree\"], \"Bachelor's degree\",inplace=True)\nresponses_df_2021['Q4'].replace([\"Masterâs degree\"], \"Master's degree\",inplace=True)\nresponses_df_2021['Q4'].replace([\"Some college/university study without earning a bachelorâs degree\"], \"Some college/university study without earning a Bachelor's degree\",inplace=True)\n\nquestion_name = 'Q4'\nresponses_in_order = [\"I prefer not to answer\",\"No formal education past high school\",\n                      \"Some college/university study without earning a Bachelor's degree\",\n                      \"Bachelor's degree\",\"Master's degree\",\"Doctoral degree\",\"Professional doctorate\"]\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name)[responses_in_order]\ntitle_for_chart = 'Most Common Degree Type'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'v'\n  \nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) \n","metadata":{"_kg_hide-input":true,"id":"K6Ss9RjSHsxP","papermill":{"duration":0.221674,"end_time":"2021-10-13T23:01:13.006995","exception":false,"start_time":"2021-10-13T23:01:12.785321","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:02.928032Z","iopub.execute_input":"2022-07-07T16:18:02.928350Z","iopub.status.idle":"2022-07-07T16:18:03.020147Z","shell.execute_reply.started":"2022-07-07T16:18:02.928324Z","shell.execute_reply":"2022-07-07T16:18:03.019498Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"responses_df_2017['FormalEducation'].replace([\"Master's degree\"], \"Master's degree\",inplace=True)\nresponses_df_2017['FormalEducation'].replace([\"Bachelor's degree\"], \"Bachelor's degree\",inplace=True)\nresponses_df_2018['Q4'].replace([\"Masterâs degree\"], \"Master's degree\",inplace=True)\nresponses_df_2019['Q4'].replace([\"Masterâs degree\"], \"Master's degree\",inplace=True)\nresponses_df_2020['Q4'].replace([\"Masterâs degree\"], \"Master's degree\",inplace=True)\nresponses_df_2021['Q4'].replace([\"Masterâs degree\"], \"Master's degree\",inplace=True)\nresponses_df_2018['Q4'].replace([\"Bachelorâs degree\"], \"Bachelor's degree\",inplace=True)\nresponses_df_2019['Q4'].replace([\"Bachelorâs degree\"], \"Bachelor's degree\",inplace=True)\nresponses_df_2020['Q4'].replace([\"Bachelorâs degree\"], \"Bachelor's degree\",inplace=True)\nresponses_df_2021['Q4'].replace([\"Bachelorâs degree\"], \"Bachelor's degree\",inplace=True)\n\nsubset_of_degrees = [\"Bachelor's degree\",\"Master's degree\",\"Doctoral degree\"]\nresponses_df_2017.FormalEducation[~responses_df_2017.FormalEducation.isin(subset_of_degrees)] = \"Other\"\nresponses_df_2018.Q4[~responses_df_2018.Q4.isin(subset_of_degrees)] = \"Other\"\nresponses_df_2019.Q4[~responses_df_2019.Q4.isin(subset_of_degrees)] = \"Other\"\nresponses_df_2020.Q4[~responses_df_2020.Q4.isin(subset_of_degrees)] = \"Other\"\nresponses_df_2021.Q4[~responses_df_2021.Q4.isin(subset_of_degrees)] = \"Other\"\n\nquestion_name = 'Q4'\nsorted_percentages_2017 = count_then_return_percent(responses_df_2017,'FormalEducation')\nsorted_percentages_2018 = count_then_return_percent(responses_df_2018,question_name)\nsorted_percentages_2019 = count_then_return_percent(responses_df_2019,question_name)#\nsorted_percentages_2020 = count_then_return_percent(responses_df_2020,question_name)\nsorted_percentages_2021 = count_then_return_percent(responses_df_2021,question_name)\ntitle_for_chart = 'Most Common Degree Type on Kaggle from 2017-2021'\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2017 Kaggle Survey', x=pd.Series(sorted_percentages_2017.index), y=pd.Series(sorted_percentages_2017)),\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(sorted_percentages_2018.index), y=pd.Series(sorted_percentages_2018)),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(sorted_percentages_2019.index), y=pd.Series(sorted_percentages_2019)),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(sorted_percentages_2020.index), y=pd.Series(sorted_percentages_2020)),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(sorted_percentages_2021.index), y=pd.Series(sorted_percentages_2021))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.19619,"end_time":"2021-10-13T23:01:13.336121","exception":false,"start_time":"2021-10-13T23:01:13.139931","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.021251Z","iopub.execute_input":"2022-07-07T16:18:03.021590Z","iopub.status.idle":"2022-07-07T16:18:03.084025Z","shell.execute_reply.started":"2022-07-07T16:18:03.021562Z","shell.execute_reply":"2022-07-07T16:18:03.083440Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q5'\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name).iloc[::-1]\ntitle_for_chart = 'Most Common Job Titles'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"9r9ldtX5HsxR","papermill":{"duration":0.228561,"end_time":"2021-10-13T23:01:13.702714","exception":false,"start_time":"2021-10-13T23:01:13.474153","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.085050Z","iopub.execute_input":"2022-07-07T16:18:03.085369Z","iopub.status.idle":"2022-07-07T16:18:03.166192Z","shell.execute_reply.started":"2022-07-07T16:18:03.085343Z","shell.execute_reply":"2022-07-07T16:18:03.165430Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q6'\ntitle_for_chart = 'Programming Experience'\ntitle_for_y_axis = '% of respondents'\nresponses_in_order = ['I have never written code',\n                      '< 1 years','1-3 years','3-5 years',\n                      '5-10 years','10-20 years','20+ years']\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name)[responses_in_order]\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"_kg_hide-output":false,"id":"hesdoX_HHsxW","papermill":{"duration":0.235156,"end_time":"2021-10-13T23:01:14.083899","exception":false,"start_time":"2021-10-13T23:01:13.848743","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.167467Z","iopub.execute_input":"2022-07-07T16:18:03.167701Z","iopub.status.idle":"2022-07-07T16:18:03.254439Z","shell.execute_reply.started":"2022-07-07T16:18:03.167674Z","shell.execute_reply":"2022-07-07T16:18:03.253663Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q7'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q7_list_of_columns_2021,\n                                                  q7_dictionary_of_counts_2021)\ntitle_for_chart = 'Most Popular Progamming Languages'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"gKZ9b04cHsxZ","papermill":{"duration":0.240847,"end_time":"2021-10-13T23:01:14.476946","exception":false,"start_time":"2021-10-13T23:01:14.236099","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.255960Z","iopub.execute_input":"2022-07-07T16:18:03.256444Z","iopub.status.idle":"2022-07-07T16:18:03.345008Z","shell.execute_reply.started":"2022-07-07T16:18:03.256403Z","shell.execute_reply":"2022-07-07T16:18:03.344252Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"q7_dictionary_of_counts_2018_simplified = {\n    'Python' : (responses_df_2018['Q16_Part_1'].count()),\n    'SQL' : (responses_df_2018['Q16_Part_3'].count()),\n    'R': (responses_df_2018['Q16_Part_2'].count()),\n    'Javascript': (responses_df_2018['Q16_Part_7'].count())\n}\n\nq7_dictionary_of_counts_2019_simplified = {\n    'Python' : (responses_df_2019['Q18_Part_1'].count()),\n    'SQL' : (responses_df_2019['Q18_Part_3'].count()),\n    'R': (responses_df_2019['Q18_Part_2'].count()),\n    'Javascript': (responses_df_2019['Q18_Part_7'].count())\n}\n\nq7_dictionary_of_counts_2020_simplified = {\n    'Python' : (responses_df_2020['Q7_Part_1'].count()),\n    'SQL' : (responses_df_2020['Q7_Part_3'].count()),\n    'R': (responses_df_2020['Q7_Part_2'].count()),\n    'Javascript': (responses_df_2020['Q7_Part_7'].count())\n}\n\nq7_dictionary_of_counts_2021_simplified = {\n    'Python' : (responses_df_2021['Q7_Part_1'].count()),\n    'SQL' : (responses_df_2021['Q7_Part_3'].count()),\n    'R': (responses_df_2021['Q7_Part_2'].count()),\n    'Javascript': (responses_df_2021['Q7_Part_7'].count())\n}\n\n\ndictionary_of_counts_2018 = sort_dictionary_by_percent(responses_df_2018,\n                                                  q7_list_of_columns_2018,\n                                                  q7_dictionary_of_counts_2018_simplified)\ndictionary_of_counts_2019 = sort_dictionary_by_percent(responses_df_2019,\n                                                  q7_list_of_columns_2019,\n                                                  q7_dictionary_of_counts_2019_simplified)\ndictionary_of_counts_2020 = sort_dictionary_by_percent(responses_df_2020,\n                                                  q7_list_of_columns_2020,\n                                                  q7_dictionary_of_counts_2020_simplified)\ndictionary_of_counts_2021 = sort_dictionary_by_percent(responses_df_2021,\n                                                  q7_list_of_columns_2021,\n                                                  q7_dictionary_of_counts_2021_simplified)\n\ntitle_for_chart = 'Most Popular Progamming Languages on Kaggle from 2018-2020'\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(dictionary_of_counts_2018.keys()), y=pd.Series(dictionary_of_counts_2018.values())),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(dictionary_of_counts_2019.keys()), y=pd.Series(dictionary_of_counts_2019.values())),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(dictionary_of_counts_2020.keys()), y=pd.Series(dictionary_of_counts_2020.values())),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(dictionary_of_counts_2021.keys()), y=pd.Series(dictionary_of_counts_2021.values()))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.225473,"end_time":"2021-10-13T23:01:14.863135","exception":false,"start_time":"2021-10-13T23:01:14.637662","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.346641Z","iopub.execute_input":"2022-07-07T16:18:03.347147Z","iopub.status.idle":"2022-07-07T16:18:03.411504Z","shell.execute_reply.started":"2022-07-07T16:18:03.347106Z","shell.execute_reply":"2022-07-07T16:18:03.410682Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q8'\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name).iloc[::-1]\ntitle_for_chart = 'Which language should you learn first?'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"hu4fvrikHsxb","papermill":{"duration":0.25089,"end_time":"2021-10-13T23:01:15.283274","exception":false,"start_time":"2021-10-13T23:01:15.032384","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.413274Z","iopub.execute_input":"2022-07-07T16:18:03.413825Z","iopub.status.idle":"2022-07-07T16:18:03.498802Z","shell.execute_reply.started":"2022-07-07T16:18:03.413783Z","shell.execute_reply":"2022-07-07T16:18:03.497985Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q9'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q9_list_of_columns_2021,\n                                                  q9_dictionary_of_counts_2021)\ntitle_for_chart = \"Most Popular Data Science IDE's\"\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"rBp4febLHsxe","papermill":{"duration":0.30374,"end_time":"2021-10-13T23:01:15.761861","exception":false,"start_time":"2021-10-13T23:01:15.458121","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.500355Z","iopub.execute_input":"2022-07-07T16:18:03.500870Z","iopub.status.idle":"2022-07-07T16:18:03.587448Z","shell.execute_reply.started":"2022-07-07T16:18:03.500829Z","shell.execute_reply":"2022-07-07T16:18:03.586650Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"q9_dictionary_of_counts_2018_simplified = {\n    'Jupyter/JupyterLab' : (responses_df_2018['Q13_Part_1'].count()),\n    'RStudio': (responses_df_2018['Q13_Part_2'].count()),\n    'Visual Studio Code (VSCode)' : (responses_df_2018['Q13_Part_4'].count()),\n    'MATLAB' : (responses_df_2018['Q13_Part_7'].count()),\n}\n\nq9_dictionary_of_counts_2019_simplified = {\n    'Jupyter/JupyterLab' : (responses_df_2019['Q16_Part_1'].count()),\n    'RStudio': (responses_df_2019['Q16_Part_2'].count()),\n    'Visual Studio Code (VSCode)' : (responses_df_2019['Q16_Part_6'].count()),\n    'MATLAB' : (responses_df_2019['Q16_Part_5'].count()),\n}\n\nq9_dictionary_of_counts_2020_simplified = {\n    'Jupyter/JupyterLab' : (responses_df_2020['Q9_Part_1'].count()),\n    'RStudio': (responses_df_2020['Q9_Part_2'].count()),\n    'Visual Studio Code (VSCode)' : (responses_df_2020['Q9_Part_4'].count()),\n    'MATLAB' : (responses_df_2020['Q9_Part_10'].count()),\n}\n\ncolumns_to_combine = ['Q9_Part_1','Q9_Part_11'] # Make a \"either jupyter or jupyterlab column instead of just jupyter+jupyterlab\"\nresponses_df_2021['Jupyter/Jupyterlab'] = (responses_df_2021[columns_to_combine].notna()).any(axis=\"columns\")\nresponses_df_2021['Jupyter/Jupyterlab'].replace([True], \"Jupyter/JupyterLab\",inplace=True)\nresponses_df_2021['Jupyter/Jupyterlab'].replace([False], np.nan,inplace=True)\n\nq9_dictionary_of_counts_2021_simplified = {\n    'Jupyter/JupyterLab' : (responses_df_2021['Jupyter/Jupyterlab'].count()),\n    'RStudio': (responses_df_2021['Q9_Part_2'].count()),\n    'Visual Studio Code (VSCode)' : (responses_df_2021['Q9_Part_4'].count()),\n    'MATLAB' : (responses_df_2021['Q9_Part_10'].count()),\n}\n\ndictionary_of_counts_2018 = sort_dictionary_by_percent(responses_df_2018,\n                                                  q9_list_of_columns_2018,\n                                                  q9_dictionary_of_counts_2018_simplified)\ndictionary_of_counts_2019 = sort_dictionary_by_percent(responses_df_2019,\n                                                  q9_list_of_columns_2019,\n                                                  q9_dictionary_of_counts_2019_simplified)\ndictionary_of_counts_2020 = sort_dictionary_by_percent(responses_df_2020,\n                                                  q9_list_of_columns_2020,\n                                                  q9_dictionary_of_counts_2020_simplified)\ndictionary_of_counts_2021 = sort_dictionary_by_percent(responses_df_2021,\n                                                  q9_list_of_columns_2021,\n                                                  q9_dictionary_of_counts_2021_simplified)\n\ntitle_for_chart = \"Most Popular Data Science IDE's from 2018-2021\"\ntitle_for_y_axis = '% of respondents'\n                                                       \nfig = go.Figure(data=[\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(dictionary_of_counts_2018.keys()), y=pd.Series(dictionary_of_counts_2018.values())),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(dictionary_of_counts_2019.keys()), y=pd.Series(dictionary_of_counts_2019.values())),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(dictionary_of_counts_2020.keys()), y=pd.Series(dictionary_of_counts_2020.values())),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(dictionary_of_counts_2021.keys()), y=pd.Series(dictionary_of_counts_2021.values()))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.282432,"end_time":"2021-10-13T23:01:16.223699","exception":false,"start_time":"2021-10-13T23:01:15.941267","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.589139Z","iopub.execute_input":"2022-07-07T16:18:03.589603Z","iopub.status.idle":"2022-07-07T16:18:03.695551Z","shell.execute_reply.started":"2022-07-07T16:18:03.589564Z","shell.execute_reply":"2022-07-07T16:18:03.694997Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q10'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q10_list_of_columns_2021,\n                                                  q10_dictionary_of_counts_2021)\ntitle_for_chart = \"Most Popular Hosted Notebook Products\"\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"1aabo5dPHsxg","papermill":{"duration":0.277028,"end_time":"2021-10-13T23:01:16.686454","exception":false,"start_time":"2021-10-13T23:01:16.409426","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.696575Z","iopub.execute_input":"2022-07-07T16:18:03.696887Z","iopub.status.idle":"2022-07-07T16:18:03.785258Z","shell.execute_reply.started":"2022-07-07T16:18:03.696861Z","shell.execute_reply":"2022-07-07T16:18:03.784472Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"q10_dictionary_of_counts_2018_simplified = {\n    'Kaggle Notebooks' : (responses_df_2018['Q14_Part_1'].count()),\n    'Colab Notebooks': (responses_df_2018['Q14_Part_2'].count())\n}\n\nq10_dictionary_of_counts_2019_simplified = {\n    'Kaggle Notebooks' : (responses_df_2019['Q17_Part_1'].count()),\n    'Colab Notebooks': (responses_df_2019['Q17_Part_2'].count())\n}\n\nq10_dictionary_of_counts_2020_simplified = {\n    'Kaggle Notebooks' : (responses_df_2020['Q10_Part_1'].count()),\n    'Colab Notebooks': (responses_df_2020['Q10_Part_2'].count())\n}\n\nq10_dictionary_of_counts_2021_simplified = {\n    'Kaggle Notebooks' : (responses_df_2021['Q10_Part_1'].count()),\n    'Colab Notebooks': (responses_df_2021['Q10_Part_2'].count())\n}\n\ndictionary_of_counts_2018 = sort_dictionary_by_percent(responses_df_2018,\n                                                  q10_list_of_columns_2018,\n                                                  q10_dictionary_of_counts_2018_simplified)\ndictionary_of_counts_2019 = sort_dictionary_by_percent(responses_df_2019,\n                                                  q10_list_of_columns_2019,\n                                                  q10_dictionary_of_counts_2019_simplified)\ndictionary_of_counts_2020 = sort_dictionary_by_percent(responses_df_2020,\n                                                  q10_list_of_columns_2020,\n                                                  q10_dictionary_of_counts_2020_simplified)\ndictionary_of_counts_2021 = sort_dictionary_by_percent(responses_df_2021,\n                                                  q10_list_of_columns_2021,\n                                                  q10_dictionary_of_counts_2021_simplified)\n\ntitle_for_chart = \"Most Popular Hosted Notebook Products from 2018-2021\"\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(dictionary_of_counts_2018.keys()), y=pd.Series(dictionary_of_counts_2018.values())),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(dictionary_of_counts_2019.keys()), y=pd.Series(dictionary_of_counts_2019.values())),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(dictionary_of_counts_2020.keys()), y=pd.Series(dictionary_of_counts_2020.values())),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(dictionary_of_counts_2021.keys()), y=pd.Series(dictionary_of_counts_2021.values()))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.247472,"end_time":"2021-10-13T23:01:17.126245","exception":false,"start_time":"2021-10-13T23:01:16.878773","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.786450Z","iopub.execute_input":"2022-07-07T16:18:03.786803Z","iopub.status.idle":"2022-07-07T16:18:03.845151Z","shell.execute_reply.started":"2022-07-07T16:18:03.786774Z","shell.execute_reply":"2022-07-07T16:18:03.844542Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q11'\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name).iloc[::-1]\ntitle_for_chart = 'Most popular computing platforms'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'v'\n  \nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"lvIoinpqHsxi","papermill":{"duration":0.280515,"end_time":"2021-10-13T23:01:17.603206","exception":false,"start_time":"2021-10-13T23:01:17.322691","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.846290Z","iopub.execute_input":"2022-07-07T16:18:03.846652Z","iopub.status.idle":"2022-07-07T16:18:03.931751Z","shell.execute_reply.started":"2022-07-07T16:18:03.846625Z","shell.execute_reply":"2022-07-07T16:18:03.930639Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q12'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q12_list_of_columns_2021,\n                                                  q12_dictionary_of_counts_2021)\ntitle_for_chart = 'Most common accelerator type'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"g7dnY1vNHsxl","papermill":{"duration":0.287376,"end_time":"2021-10-13T23:01:18.14062","exception":false,"start_time":"2021-10-13T23:01:17.853244","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:03.933033Z","iopub.execute_input":"2022-07-07T16:18:03.933288Z","iopub.status.idle":"2022-07-07T16:18:04.019735Z","shell.execute_reply.started":"2022-07-07T16:18:03.933259Z","shell.execute_reply":"2022-07-07T16:18:04.018809Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"q12_dictionary_of_counts_2019_simplified = {\n    'Google Cloud TPUs': (responses_df_2019['Q21_Part_3'].count())\n}\n\nq12_dictionary_of_counts_2020_simplified = {\n    'Google Cloud TPUs': (responses_df_2020['Q12_Part_2'].count())\n}\n\nq12_dictionary_of_counts_2021_simplified = {\n    'Google Cloud TPUs': (responses_df_2021['Q12_Part_2'].count())\n}\n\n\ndictionary_of_counts_2019 = sort_dictionary_by_percent(responses_df_2019,\n                                                  q12_list_of_columns_2019,\n                                                  q12_dictionary_of_counts_2019_simplified)\ndictionary_of_counts_2020 = sort_dictionary_by_percent(responses_df_2020,\n                                                  q12_list_of_columns_2020,\n                                                  q12_dictionary_of_counts_2020_simplified)\ndictionary_of_counts_2021 = sort_dictionary_by_percent(responses_df_2021,\n                                                  q12_list_of_columns_2021,\n                                                  q12_dictionary_of_counts_2021_simplified)\n\ntitle_for_chart = \"Regular Usage of TPUs from 2019-2021\"\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(dictionary_of_counts_2019.keys()), y=pd.Series(dictionary_of_counts_2019.values())),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(dictionary_of_counts_2020.keys()), y=pd.Series(dictionary_of_counts_2020.values())),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(dictionary_of_counts_2021.keys()), y=pd.Series(dictionary_of_counts_2021.values()))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.248085,"end_time":"2021-10-13T23:01:18.599315","exception":false,"start_time":"2021-10-13T23:01:18.35123","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.021205Z","iopub.execute_input":"2022-07-07T16:18:04.021605Z","iopub.status.idle":"2022-07-07T16:18:04.061043Z","shell.execute_reply.started":"2022-07-07T16:18:04.021561Z","shell.execute_reply":"2022-07-07T16:18:04.060447Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q13'\nresponses_in_order = ['Never','Once','2-5 times','6-25 times','More than 25 times']\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name)[responses_in_order]\ntitle_for_chart = 'Number of times using a TPU'\ny_axis_title = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"tEqW-jYGHsxn","papermill":{"duration":0.301823,"end_time":"2021-10-13T23:01:19.117413","exception":false,"start_time":"2021-10-13T23:01:18.81559","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.062049Z","iopub.execute_input":"2022-07-07T16:18:04.062663Z","iopub.status.idle":"2022-07-07T16:18:04.147033Z","shell.execute_reply.started":"2022-07-07T16:18:04.062626Z","shell.execute_reply":"2022-07-07T16:18:04.146208Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"responses_df_2021_backup = responses_df_2021.copy()\nresponses_df_2019['Q22'].replace([\"> 25 times\"], \"More than 25 times\",inplace=True)\nresponses_df_2019['Q22'].replace([\"6-24 times\"], \"6-25 times\",inplace=True)\n\nsorted_percentages_2019 = count_then_return_percent(responses_df_2019,'Q22').iloc[::-1]\nsorted_percentages_2020 = count_then_return_percent(responses_df_2020,'Q13').iloc[::-1]\nsorted_percentages_2021 = count_then_return_percent(responses_df_2021,'Q13').iloc[::-1]\n\ntitle_for_chart = 'Frequency of TPU Usage from 2019 to 2021'\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(sorted_percentages_2019.index), y=pd.Series(sorted_percentages_2019)),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(sorted_percentages_2020.index), y=pd.Series(sorted_percentages_2020)),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(sorted_percentages_2021.index), y=pd.Series(sorted_percentages_2021))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()\nresponses_df_2021 = responses_df_2021_backup.copy()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.334414,"end_time":"2021-10-13T23:01:19.719018","exception":false,"start_time":"2021-10-13T23:01:19.384604","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.148370Z","iopub.execute_input":"2022-07-07T16:18:04.148872Z","iopub.status.idle":"2022-07-07T16:18:04.211508Z","shell.execute_reply.started":"2022-07-07T16:18:04.148828Z","shell.execute_reply":"2022-07-07T16:18:04.210630Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"q14_dictionary_of_counts_2018_simplified = {\n    'Matplotlib' : (responses_df_2018['Q21_Part_2'].count()),\n    'Seaborn': (responses_df_2018['Q21_Part_8'].count()),\n    'Plotly / Plotly Express' : (responses_df_2018['Q21_Part_6'].count()),\n    'Ggplot / ggplot2' : (responses_df_2018['Q21_Part_1'].count())\n}\n\nq14_dictionary_of_counts_2019_simplified = {\n    'Matplotlib' : (responses_df_2019['Q20_Part_2'].count()),\n    'Seaborn': (responses_df_2019['Q20_Part_8'].count()),\n    'Plotly / Plotly Express' : (responses_df_2019['Q20_Part_6'].count()),\n    'Ggplot / ggplot2' : (responses_df_2019['Q20_Part_1'].count())\n}\n\nq14_dictionary_of_counts_2020_simplified = {\n    'Matplotlib' : (responses_df_2020['Q14_Part_1'].count()),\n    'Seaborn': (responses_df_2020['Q14_Part_2'].count()),\n    'Plotly / Plotly Express' : (responses_df_2020['Q14_Part_3'].count()),\n    'Ggplot / ggplot2' : (responses_df_2020['Q14_Part_4'].count())\n}\n\nq14_dictionary_of_counts_2021_simplified = {\n    'Matplotlib' : (responses_df_2021['Q14_Part_1'].count()),\n    'Seaborn': (responses_df_2021['Q14_Part_2'].count()),\n    'Plotly / Plotly Express' : (responses_df_2021['Q14_Part_3'].count()),\n    'Ggplot / ggplot2' : (responses_df_2021['Q14_Part_4'].count())\n}\n\ndictionary_of_counts_2018 = sort_dictionary_by_percent(responses_df_2018,\n                                                  q14_list_of_columns_2018,\n                                                  q14_dictionary_of_counts_2018_simplified)\ndictionary_of_counts_2019 = sort_dictionary_by_percent(responses_df_2019,\n                                                  q14_list_of_columns_2019,\n                                                  q14_dictionary_of_counts_2019_simplified)\ndictionary_of_counts_2020 = sort_dictionary_by_percent(responses_df_2020,\n                                                  q14_list_of_columns_2020,\n                                                  q14_dictionary_of_counts_2020_simplified)\ndictionary_of_counts_2021 = sort_dictionary_by_percent(responses_df_2021,\n                                                  q14_list_of_columns_2021,\n                                                  q14_dictionary_of_counts_2021_simplified)\n\ntitle_for_chart = 'Most common data visualization tools from 2018-2021'\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(dictionary_of_counts_2018.keys()), y=pd.Series(dictionary_of_counts_2018.values())),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(dictionary_of_counts_2019.keys()), y=pd.Series(dictionary_of_counts_2019.values())),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(dictionary_of_counts_2020.keys()), y=pd.Series(dictionary_of_counts_2020.values())),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(dictionary_of_counts_2021.keys()), y=pd.Series(dictionary_of_counts_2021.values()))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.290995,"end_time":"2021-10-13T23:01:20.296695","exception":false,"start_time":"2021-10-13T23:01:20.0057","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.212788Z","iopub.execute_input":"2022-07-07T16:18:04.213059Z","iopub.status.idle":"2022-07-07T16:18:04.276043Z","shell.execute_reply.started":"2022-07-07T16:18:04.213029Z","shell.execute_reply":"2022-07-07T16:18:04.274991Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q14'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q14_list_of_columns_2021,\n                                                  q14_dictionary_of_counts_2021)\ntitle_for_chart = 'Most common data visualization tools'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"qUga8afoHsxp","papermill":{"duration":0.322611,"end_time":"2021-10-13T23:01:20.856054","exception":false,"start_time":"2021-10-13T23:01:20.533443","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.277743Z","iopub.execute_input":"2022-07-07T16:18:04.278061Z","iopub.status.idle":"2022-07-07T16:18:04.367359Z","shell.execute_reply.started":"2022-07-07T16:18:04.278020Z","shell.execute_reply":"2022-07-07T16:18:04.366468Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q15'\nresponses_in_order = ['I do not use machine learning methods',\n                      'Under 1 year','1-2 years','2-3 years',\n                      '3-4 years','4-5 years','5-10 years',\n                     '10-20 years', '20 or more years']\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name)[responses_in_order]\ntitle_for_chart = 'Number of years using ML methods'\ny_axis_title = '% of respondents'\norientation_for_chart = 'h'\n\nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"bujV_BUAHsxs","papermill":{"duration":0.33529,"end_time":"2021-10-13T23:01:21.438982","exception":false,"start_time":"2021-10-13T23:01:21.103692","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.368807Z","iopub.execute_input":"2022-07-07T16:18:04.369342Z","iopub.status.idle":"2022-07-07T16:18:04.453619Z","shell.execute_reply.started":"2022-07-07T16:18:04.369311Z","shell.execute_reply":"2022-07-07T16:18:04.452830Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q16'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q16_list_of_columns_2021,\n                                                  q16_dictionary_of_counts_2021)\ntitle_for_chart = 'Most common machine learning frameworks'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"AB3YyuQpHsxu","papermill":{"duration":0.400098,"end_time":"2021-10-13T23:01:22.090687","exception":false,"start_time":"2021-10-13T23:01:21.690589","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.454875Z","iopub.execute_input":"2022-07-07T16:18:04.455159Z","iopub.status.idle":"2022-07-07T16:18:04.543644Z","shell.execute_reply.started":"2022-07-07T16:18:04.455127Z","shell.execute_reply":"2022-07-07T16:18:04.542731Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"q16_dictionary_of_counts_2018_simplified = {\n    'Scikit-learn' : (responses_df_2018['Q19_Part_1'].count()),\n    'TensorFlow': (responses_df_2018['Q19_Part_2'].count()),\n    'Keras' : (responses_df_2018['Q19_Part_3'].count()),\n    'PyTorch' : (responses_df_2018['Q19_Part_4'].count()),\n    'Fast.ai' : (responses_df_2018['Q19_Part_7'].count()),\n    'Xgboost' : (responses_df_2018['Q19_Part_10'].count()),\n    'LightGBM' : (responses_df_2018['Q19_Part_14'].count()),\n    'CatBoost' : (responses_df_2018['Q19_Part_15'].count())\n}\n\nq16_dictionary_of_counts_2019_simplified = {\n    'Scikit-learn' : (responses_df_2019['Q28_Part_1'].count()),\n    'TensorFlow': (responses_df_2019['Q28_Part_2'].count()),\n    'Keras' : (responses_df_2019['Q28_Part_3'].count()),\n    'PyTorch' : (responses_df_2019['Q28_Part_6'].count()),\n    'Fast.ai' : (responses_df_2019['Q28_Part_10'].count()),\n    'Xgboost' : (responses_df_2019['Q28_Part_5'].count()),\n    'LightGBM' : (responses_df_2019['Q28_Part_8'].count())\n}\n\nq16_dictionary_of_counts_2020_simplified = {\n    'Scikit-learn' : (responses_df_2020['Q16_Part_1'].count()),\n    'TensorFlow': (responses_df_2020['Q16_Part_2'].count()),\n    'Keras' : (responses_df_2020['Q16_Part_3'].count()),\n    'PyTorch' : (responses_df_2020['Q16_Part_4'].count()),\n    'Fast.ai' : (responses_df_2020['Q16_Part_5'].count()),\n    'Xgboost' : (responses_df_2020['Q16_Part_7'].count()),\n    'LightGBM' : (responses_df_2020['Q16_Part_8'].count()),\n    'CatBoost' : (responses_df_2020['Q16_Part_9'].count()),\n}\n\nq16_dictionary_of_counts_2021_simplified = {\n    'Scikit-learn' : (responses_df_2021['Q16_Part_1'].count()),\n    'TensorFlow': (responses_df_2021['Q16_Part_2'].count()),\n    'Keras' : (responses_df_2021['Q16_Part_3'].count()),\n    'PyTorch' : (responses_df_2021['Q16_Part_4'].count()),\n    'Fast.ai' : (responses_df_2021['Q16_Part_5'].count()),\n    'Xgboost' : (responses_df_2021['Q16_Part_7'].count()),\n    'LightGBM' : (responses_df_2021['Q16_Part_8'].count()),\n    'CatBoost' : (responses_df_2021['Q16_Part_9'].count())\n}\n\ndictionary_of_counts_2018 = sort_dictionary_by_percent(responses_df_2018,\n                                                  q16_list_of_columns_2018,\n                                                  q16_dictionary_of_counts_2018_simplified)\ndictionary_of_counts_2019 = sort_dictionary_by_percent(responses_df_2019,\n                                                  q16_list_of_columns_2019,\n                                                  q16_dictionary_of_counts_2019_simplified)\ndictionary_of_counts_2020 = sort_dictionary_by_percent(responses_df_2020,\n                                                  q16_list_of_columns_2020,\n                                                  q16_dictionary_of_counts_2020_simplified)\ndictionary_of_counts_2021 = sort_dictionary_by_percent(responses_df_2021,\n                                                  q16_list_of_columns_2021,\n                                                  q16_dictionary_of_counts_2021_simplified)\n\ntitle_for_chart = 'Most common machine learning frameworks from 2018-2021'\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(dictionary_of_counts_2018.keys()), y=pd.Series(dictionary_of_counts_2018.values())),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(dictionary_of_counts_2019.keys()), y=pd.Series(dictionary_of_counts_2019.values())),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(dictionary_of_counts_2020.keys()), y=pd.Series(dictionary_of_counts_2020.values())),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(dictionary_of_counts_2021.keys()), y=pd.Series(dictionary_of_counts_2021.values()))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.333557,"end_time":"2021-10-13T23:01:22.683143","exception":false,"start_time":"2021-10-13T23:01:22.349586","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.544944Z","iopub.execute_input":"2022-07-07T16:18:04.545286Z","iopub.status.idle":"2022-07-07T16:18:04.620033Z","shell.execute_reply.started":"2022-07-07T16:18:04.545255Z","shell.execute_reply":"2022-07-07T16:18:04.619451Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q17'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q17_list_of_columns_2021,\n                                                  q17_dictionary_of_counts_2021)\ntitle_for_chart = 'Most common machine learning algorithms'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"NS5e_N0eHsxx","papermill":{"duration":0.367126,"end_time":"2021-10-13T23:01:23.323572","exception":false,"start_time":"2021-10-13T23:01:22.956446","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.620889Z","iopub.execute_input":"2022-07-07T16:18:04.621606Z","iopub.status.idle":"2022-07-07T16:18:04.710648Z","shell.execute_reply.started":"2022-07-07T16:18:04.621559Z","shell.execute_reply":"2022-07-07T16:18:04.709764Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"q17_dictionary_of_counts_2019 = {\n    'Gradient Boosting Machines (xgboost, lightgbm, etc)' : (responses_df_2019['Q24_Part_3'].count()),\n    'Convolutional Neural Networks' : (responses_df_2019['Q24_Part_7'].count()),\n    'Recurrent Neural Networks' : (responses_df_2019['Q24_Part_9'].count()),\n    'Transformer Networks (BERT, gpt-3, etc)' : (responses_df_2019['Q24_Part_10'].count())\n}\n\nq17_dictionary_of_counts_2020 = {\n    'Gradient Boosting Machines (xgboost, lightgbm, etc)' : (responses_df_2020['Q17_Part_3'].count()),\n    'Convolutional Neural Networks' : (responses_df_2020['Q17_Part_7'].count()),\n    'Recurrent Neural Networks' : (responses_df_2020['Q17_Part_9'].count()),\n    'Transformer Networks (BERT, gpt-3, etc)' : (responses_df_2020['Q17_Part_10'].count())\n}\n\nq17_dictionary_of_counts_2021 = {\n    'Gradient Boosting Machines (xgboost, lightgbm, etc)' : (responses_df_2021['Q17_Part_3'].count()),\n    'Convolutional Neural Networks' : (responses_df_2021['Q17_Part_7'].count()),\n    'Recurrent Neural Networks' : (responses_df_2021['Q17_Part_9'].count()),\n    'Transformer Networks (BERT, gpt-3, etc)' : (responses_df_2021['Q17_Part_10'].count())\n}\n\n\ndictionary_of_counts_2019 = sort_dictionary_by_percent(responses_df_2019,\n                                                  q17_list_of_columns_2019,\n                                                  q17_dictionary_of_counts_2019)\ndictionary_of_counts_2020 = sort_dictionary_by_percent(responses_df_2020,\n                                                  q17_list_of_columns_2020,\n                                                  q17_dictionary_of_counts_2020)\ndictionary_of_counts_2021 = sort_dictionary_by_percent(responses_df_2021,\n                                                  q17_list_of_columns_2021,\n                                                  q17_dictionary_of_counts_2021)\n\ntitle_for_chart = 'Most common machine learning algorithms from 2019-2021'\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(dictionary_of_counts_2019.keys()), y=pd.Series(dictionary_of_counts_2019.values())),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(dictionary_of_counts_2020.keys()), y=pd.Series(dictionary_of_counts_2020.values())),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(dictionary_of_counts_2021.keys()), y=pd.Series(dictionary_of_counts_2021.values()))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.37312,"end_time":"2021-10-13T23:01:23.972438","exception":false,"start_time":"2021-10-13T23:01:23.599318","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.712354Z","iopub.execute_input":"2022-07-07T16:18:04.712900Z","iopub.status.idle":"2022-07-07T16:18:04.765759Z","shell.execute_reply.started":"2022-07-07T16:18:04.712856Z","shell.execute_reply":"2022-07-07T16:18:04.764885Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q18_list_of_columns_2021,\n                                                  q18_dictionary_of_counts_2021)\ntitle_for_chart = 'Most common computer vision methods'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'v'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"VAcNM6zyHsx0","papermill":{"duration":0.363688,"end_time":"2021-10-13T23:01:24.615626","exception":false,"start_time":"2021-10-13T23:01:24.251938","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.767096Z","iopub.execute_input":"2022-07-07T16:18:04.767969Z","iopub.status.idle":"2022-07-07T16:18:04.853639Z","shell.execute_reply.started":"2022-07-07T16:18:04.767917Z","shell.execute_reply":"2022-07-07T16:18:04.852753Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q19'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q19_list_of_columns_2021,\n                                                  q19_dictionary_of_counts_2021)\ntitle_for_chart = 'Most common NLP methods'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'v'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"OgUDy9BlHsx3","papermill":{"duration":0.374864,"end_time":"2021-10-13T23:01:25.274641","exception":false,"start_time":"2021-10-13T23:01:24.899777","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.855162Z","iopub.execute_input":"2022-07-07T16:18:04.855655Z","iopub.status.idle":"2022-07-07T16:18:04.940914Z","shell.execute_reply.started":"2022-07-07T16:18:04.855614Z","shell.execute_reply":"2022-07-07T16:18:04.940134Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q31-B'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q31b_list_of_columns_2021,\n                                                  q31b_dictionary_of_counts_2021)\ntitle_for_chart = 'Managed Machine Learning Products'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.509505,"end_time":"2021-10-13T23:01:40.21139","exception":false,"start_time":"2021-10-13T23:01:39.701885","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:04.941939Z","iopub.execute_input":"2022-07-07T16:18:04.942154Z","iopub.status.idle":"2022-07-07T16:18:05.029265Z","shell.execute_reply.started":"2022-07-07T16:18:04.942129Z","shell.execute_reply":"2022-07-07T16:18:05.028488Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q32-B'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q32b_list_of_columns_2021,\n                                                  q32b_dictionary_of_counts_2021)\ntitle_for_chart = 'Most Popular Database or Data Warehouse Products'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"l2Yj3ky9HsyQ","papermill":{"duration":0.566802,"end_time":"2021-10-13T23:01:41.209019","exception":false,"start_time":"2021-10-13T23:01:40.642217","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:05.030356Z","iopub.execute_input":"2022-07-07T16:18:05.030588Z","iopub.status.idle":"2022-07-07T16:18:05.121552Z","shell.execute_reply.started":"2022-07-07T16:18:05.030562Z","shell.execute_reply":"2022-07-07T16:18:05.120709Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q40'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q40_list_of_columns_2021,\n                                                  q40_dictionary_of_counts_2021)\ntitle_for_chart = 'Most Popular Educational Platforms'\ntitle_for_x_axis = '% of respondents'\norientation_for_chart = 'h'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"IsYpbwgVHsym","papermill":{"duration":0.680958,"end_time":"2021-10-13T23:01:52.859142","exception":false,"start_time":"2021-10-13T23:01:52.178184","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:05.295981Z","iopub.execute_input":"2022-07-07T16:18:05.296773Z","iopub.status.idle":"2022-07-07T16:18:05.386056Z","shell.execute_reply.started":"2022-07-07T16:18:05.296737Z","shell.execute_reply":"2022-07-07T16:18:05.385176Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"q36_list_of_columns_2018 = ['Q36_Part_1',\n                            'Q36_Part_2',\n                            'Q36_Part_3',\n                            'Q36_Part_4',\n                            'Q36_Part_5',\n                            'Q36_Part_6',\n                            'Q36_Part_7',\n                            'Q36_Part_8',\n                            'Q36_Part_9',\n                            'Q36_Part_10',\n                            'Q36_Part_11',\n                            'Q36_Part_12',\n                            'Q36_OTHER_TEXT']\n\nq13_list_of_columns_2019 = ['Q13_Part_1',\n                            'Q13_Part_2',\n                            'Q13_Part_3',\n                            'Q13_Part_4',\n                            'Q13_Part_5',\n                            'Q13_Part_6',\n                            'Q13_Part_7',\n                            'Q13_Part_8',\n                            'Q13_Part_9',\n                            'Q13_Part_10',\n                            'Q13_Part_11',\n                            'Q13_Part_12',\n                            'Q13_OTHER_TEXT']\n\n\nq36_dictionary_of_counts_2018_simplified = {\n    'Coursera' : (responses_df_2018['Q36_Part_2'].count()),\n    'Kaggle Learn Courses' : (responses_df_2018['Q36_Part_6'].count()),\n    'Udacity' : (responses_df_2018['Q36_Part_1'].count()),\n    'Udemy' : (responses_df_2018['Q36_Part_9'].count()),\n    'University Courses' : (responses_df_2018['Q36_Part_11'].count())\n}\n\nq13_dictionary_of_counts_2019_simplified = {\n    'Coursera' : (responses_df_2019['Q13_Part_2'].count()),\n    'Kaggle Learn Courses' : (responses_df_2019['Q13_Part_6'].count()),\n    'Udacity' : (responses_df_2019['Q13_Part_1'].count()),\n    'Udemy' : (responses_df_2019['Q13_Part_8'].count()),\n    'University Courses' : (responses_df_2019['Q13_Part_10'].count())\n}\n\nq37_dictionary_of_counts_2020_simplified = {\n    'Coursera' : (responses_df_2020['Q37_Part_1'].count()),\n    'Kaggle Learn Courses' : (responses_df_2020['Q37_Part_3'].count()),\n    'Udacity' : (responses_df_2020['Q37_Part_6'].count()),\n    'Udemy' : (responses_df_2020['Q37_Part_7'].count()),\n    'University Courses' : (responses_df_2020['Q37_Part_10'].count())\n}\n\nq40_dictionary_of_counts_2021_simplified = {\n    'Coursera' : (responses_df_2021['Q40_Part_1'].count()),\n    'Kaggle Learn Courses' : (responses_df_2021['Q40_Part_3'].count()),\n    'Udacity' : (responses_df_2021['Q40_Part_6'].count()),\n    'Udemy' : (responses_df_2021['Q40_Part_7'].count()),\n    'University Courses' : (responses_df_2021['Q40_Part_10'].count())\n}\n\n\ndictionary_of_counts_2018 = sort_dictionary_by_percent(responses_df_2018,\n                                                  q36_list_of_columns_2018,\n                                                  q36_dictionary_of_counts_2018_simplified)\ndictionary_of_counts_2019 = sort_dictionary_by_percent(responses_df_2019,\n                                                  q13_list_of_columns_2019,\n                                                  q13_dictionary_of_counts_2019_simplified)\ndictionary_of_counts_2020 = sort_dictionary_by_percent(responses_df_2020,\n                                                  q37_list_of_columns_2020,\n                                                  q37_dictionary_of_counts_2020_simplified)\ndictionary_of_counts_2021 = sort_dictionary_by_percent(responses_df_2021,\n                                                  q40_list_of_columns_2021,\n                                                  q40_dictionary_of_counts_2021_simplified)\n\ntitle_for_chart = \"Most Popular Educational Platforms from 2018-2021\"\ntitle_for_y_axis = '% of respondents'\n\nfig = go.Figure(data=[\n    go.Bar(name='2018 Kaggle Survey', x=pd.Series(dictionary_of_counts_2018.keys()), y=pd.Series(dictionary_of_counts_2018.values())),\n    go.Bar(name='2019 Kaggle Survey', x=pd.Series(dictionary_of_counts_2019.keys()), y=pd.Series(dictionary_of_counts_2019.values())),\n    go.Bar(name='2020 Kaggle Survey', x=pd.Series(dictionary_of_counts_2020.keys()), y=pd.Series(dictionary_of_counts_2020.values())),\n    go.Bar(name='2021 Kaggle Survey', x=pd.Series(dictionary_of_counts_2021.keys()), y=pd.Series(dictionary_of_counts_2021.values()))\n           ])\nfig.update_layout(barmode='group') \nfig.update_layout(title=title_for_chart,yaxis=dict(title=title_for_y_axis))\nfig.show()","metadata":{"_kg_hide-input":true,"papermill":{"duration":0.628195,"end_time":"2021-10-13T23:01:53.995007","exception":false,"start_time":"2021-10-13T23:01:53.366812","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:05.387839Z","iopub.execute_input":"2022-07-07T16:18:05.388145Z","iopub.status.idle":"2022-07-07T16:18:05.457501Z","shell.execute_reply.started":"2022-07-07T16:18:05.388105Z","shell.execute_reply":"2022-07-07T16:18:05.456619Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q41'\nsorted_percentages = count_then_return_percent(responses_df_2021,question_name).iloc[::-1]\ntitle_for_chart = 'Primary tool used to analyze data'\ny_axis_title = '% of respondents'\norientation_for_chart = 'v'\n\nplotly_bar_chart(response_counts=sorted_percentages,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"JTsaB3ohHsyn","papermill":{"duration":0.608471,"end_time":"2021-10-13T23:01:55.114004","exception":false,"start_time":"2021-10-13T23:01:54.505533","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:05.459014Z","iopub.execute_input":"2022-07-07T16:18:05.459450Z","iopub.status.idle":"2022-07-07T16:18:05.549672Z","shell.execute_reply.started":"2022-07-07T16:18:05.459407Z","shell.execute_reply":"2022-07-07T16:18:05.548646Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"question_name = 'Q42'\ndictionary_of_counts = sort_dictionary_by_percent(responses_df_2021,\n                                                  q42_list_of_columns_2021,\n                                                  q42_dictionary_of_counts_2021)\ntitle_for_chart = 'Most Popular Data Science Media Sources'\ntitle_for_y_axis = '% of respondents'\norientation_for_chart = 'v'\n  \nplotly_bar_chart(response_counts=dictionary_of_counts,\n                 title=title_for_chart,\n                 y_axis_title=title_for_y_axis,\n                 orientation=orientation_for_chart) ","metadata":{"_kg_hide-input":true,"id":"EZ8ehsTFHsyq","papermill":{"duration":0.610666,"end_time":"2021-10-13T23:01:56.304966","exception":false,"start_time":"2021-10-13T23:01:55.6943","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:05.550815Z","iopub.execute_input":"2022-07-07T16:18:05.551059Z","iopub.status.idle":"2022-07-07T16:18:05.637785Z","shell.execute_reply.started":"2022-07-07T16:18:05.551030Z","shell.execute_reply":"2022-07-07T16:18:05.636956Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Plot a histogram of user response times (~10m average)\nresponses_only_duration = responses_df_2021['Time from Start to Finish (seconds)']\nresponses_only_duration = pd.DataFrame(pd.to_numeric(responses_only_duration, errors='coerce')/60)\nresponses_only_duration.columns = ['Time from Start to Finish (minutes)']\nsns.displot(responses_only_duration,bins=15000).set(xlim=(0, 60))\nmedian = round(responses_df_2021['Time from Start to Finish (seconds)'].median()/60,0)\nprint('The median response time was approximately',median,'minutes.')\nfiltered_responses_df_2021 = pd.DataFrame(pd.to_numeric(responses_df_2021['Time from Start to Finish (seconds)'], errors='coerce'))\nfiltered_responses_df_2021 = filtered_responses_df_2021[filtered_responses_df_2021['Time from Start to Finish (seconds)'] > 299]  \nprint('The total number of respondents that took more than 5 minutes was',filtered_responses_df_2021.shape[0])","metadata":{"_kg_hide-input":true,"id":"Na5AUsm7Hsyv","papermill":{"duration":46.201989,"end_time":"2021-10-13T23:02:43.03569","exception":false,"start_time":"2021-10-13T23:01:56.833701","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:05.639014Z","iopub.execute_input":"2022-07-07T16:18:05.639246Z","iopub.status.idle":"2022-07-07T16:18:50.696355Z","shell.execute_reply.started":"2022-07-07T16:18:05.639218Z","shell.execute_reply":"2022-07-07T16:18:50.695571Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"**Future directions to consider:**\n* Divide the population into interesting subgroups and identify interesting insights.\n\n * Do students have different preferences as compared to professionals?\n * Do GCP customers have different preferences as compared to AWS customers?\n * Which cloud computing platforms have seen the most growth in recent years?\n * Do salaries scale according to experience levels?  What traits might predict having a very high salary?\n\n ","metadata":{"id":"iCf9ApliHsyz","papermill":{"duration":0.539703,"end_time":"2021-10-13T23:02:44.156951","exception":false,"start_time":"2021-10-13T23:02:43.617248","status":"completed"},"tags":[]}},{"cell_type":"markdown","source":"**Credits / Attribution:**\n\n* This notebooks uses the [2021 Kaggle DS & ML Survey dataset](https://www.kaggle.com/c/kaggle-survey-2021).  Specifically, [pandas](https://pandas.pydata.org/pandas-docs/stable/) is used to  manipulate the data and [plotly](https://plotly.com/python/) is used to visualize the data.\n* The idea to organize the value_counts() into dictionaries came from [a notebook that was authored by @sonmou](https://www.kaggle.com/sonmou/what-topics-from-where-to-learn-data-science) using the [2019 Kaggle DS & ML challenge dataset](https://www.kaggle.com/c/kaggle-survey-2019).  I liked this approach because the dictionaries themselves are useful artifacts that can be reused by other competitors and also they can be used to provide a quick way to review all of the different answer choices for each individual question.  You can find these dictionaries in code cell number four if you want to paste them into your own notebook.   \n* This notebook (and every other public notebook on Kaggle) was released under an [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0). ","metadata":{"id":"Y7V09ho8Hsyz","papermill":{"duration":0.588802,"end_time":"2021-10-13T23:02:45.280783","exception":false,"start_time":"2021-10-13T23:02:44.691981","status":"completed"},"tags":[]}},{"cell_type":"code","source":"!mkdir /kaggle/working/docker/\n!pip freeze > '/kaggle/working/docker/requirements.txt'\nprint('This notebook makes use of \\nthe following Python libraries:\\n')\nprint('numpy:',np.__version__)\nprint('pandas:',pd.__version__)\nprint('seaborn:',sns.__version__)\nimport plotly_express as px\nprint('plotly express:',px.__version__)\nsurvey_df_2021.to_csv('2021_kaggle_ds_and_ml_survey_responses_from_students_only.csv',index=False)","metadata":{"_kg_hide-input":true,"id":"w2NRyBYsHsy0","papermill":{"duration":6.576645,"end_time":"2021-10-13T23:02:52.398224","exception":false,"start_time":"2021-10-13T23:02:45.821579","status":"completed"},"tags":[],"execution":{"iopub.status.busy":"2022-07-07T16:18:50.697587Z","iopub.execute_input":"2022-07-07T16:18:50.698046Z","iopub.status.idle":"2022-07-07T16:18:54.500403Z","shell.execute_reply.started":"2022-07-07T16:18:50.698013Z","shell.execute_reply":"2022-07-07T16:18:54.499520Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"id":"vGIA8oMWHsy1","papermill":{"duration":0.53246,"end_time":"2021-10-13T23:02:53.517881","exception":false,"start_time":"2021-10-13T23:02:52.985421","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"papermill":{"duration":0.554046,"end_time":"2021-10-13T23:02:54.686042","exception":false,"start_time":"2021-10-13T23:02:54.131996","status":"completed"},"tags":[]},"execution_count":null,"outputs":[]}]}