<jupyter_start><jupyter_text>Kaggle ML & DS Survey 2019 Analysis<jupyter_code>df=pd.read_csv("multiple_choice_responses.csv",low_memory=False) #Reading Survey Answers
df.head()
print("Number of Survey takers:",df.shape[0]-1)
df.columns
df.isnull().sum()
df_ques=pd.read_csv("questions_only.csv")# Reading the Question Schema
df_ques.head()
i=0
for q in df_ques.iloc[0]:
    print(i,q)
    i=i+1<jupyter_output>0 Duration (in seconds)
1 What is your age (# years)?
2 What is your gender? - Selected Choice
3 In which country do you currently reside?
4 What is the highest level of formal education that you have attained or plan to attain within the next 2 years?
5 Select the title most similar to your current role (or most recent title if retired): - Selected Choice
6 What is the size of the company where you are employed?
7 Approximately how many individuals are responsible for data science workloads at your place of business?
8 Does your current employer incorporate machine learning methods into their business?
9 Select any activities that make up an important part of your role at work: (Select all that apply) - Selected Choice
10 What is your current yearly compensation (approximate $USD)?
11 Approximately how much money have you spent on machine learning and/or cloud computing products at your work in the past 5 years?
12 Who/what are your favorite media sources that report on data science t[...]<jupyter_text>Top 10 Countries<jupyter_code>df['Q3'].value_counts().head(10).plot(kind='pie',title="Top 10 Countries")<jupyter_output><empty_output><jupyter_text>India being the largest country. Let us answer some questions regarding India<jupyter_code>df=df[df['Q3']=="India"].reset_index()#Selecting only Indian responses
df=df.drop('index',axis=1)
df.head()<jupyter_output><empty_output><jupyter_text>Part I: What is the gender distribution in the field?¶<jupyter_code>labels = ['Male', 'Female', 'Other']
sizes = [df['Q2'].value_counts()[0],
         df['Q2'].value_counts()[1],
         df['Q2'].value_counts()[2]+df['Q2'].value_counts()[3]
        ]
fig1, ax1 = plt.subplots()
ax1.pie(sizes, labels=labels, autopct='%1.1f%%')
ax1.axis('equal')
plt.title('Gender Distribution')
plt.show()<jupyter_output><empty_output><jupyter_text>Part II: Do people with postgraduate degree earn more in India?¶<jupyter_code>#Considering only working professionals having a college degree
undergrad = ['Bachelor’s degree'] 
postgrad=['Master’s degree','Doctoral degree']
unemployed=['Student','Not employed']
employed_df = df.loc[~df['Q5'].isin(unemployed)] 
employed_df.loc[employed_df['Q4'].isin(undergrad)]['Q10'].dropna().value_counts().plot.bar(colormap='Paired',title="Undegraduate Salary Distribution");
employed_df.loc[employed_df['Q4'].isin(postgrad)]['Q10'].dropna().value_counts().plot.bar(colormap='winter',title="Postgraduate Salary Distribution");<jupyter_output><empty_output><jupyter_text>Part III: What job roles most Indian Kagglers have?¶<jupyter_code>employed_df["Q5"].dropna().value_counts().plot.barh(colormap='spring',title="Job Roles");<jupyter_output><empty_output><jupyter_text>Part IV: What is the age distribution of Indian Kagglers?<jupyter_code>df['Q1'].value_counts().plot(kind='area',colormap='summer',title='Age Distribution');<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12959028831562974, 'fraction_numerical': 0.017905918057663128, 'mean_word_length': 7.219451371571072, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '215281', 'license': 'MIT', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1037, 'n_words': 297, 'path': 'Kaggle_India.ipynb', 'repo_name': 'curiousrohan/kaggle-india-analysis', 'size': '3295'}