# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# #### Job Satisfaction
#
# In this notebook, you will be exploring job satisfaction according to the survey results.  Use the cells at the top of the notebook to explore as necessary, and use your findings to solve the questions at the bottom of the notebook.

# +
import pandas as pd
import numpy as np
import JobSatisfaction as t
import matplotlib.pyplot as plt
# %matplotlib inline

df = pd.read_csv('./survey_results_public.csv')
schema = pd.read_csv('./survey_results_schema.csv')
df.head()
# -

# #### Used to Answer Question 1

df['JobSatisfaction'].isnull().mean() # missing values

df.groupby(['EmploymentStatus']).mean()['JobSatisfaction']

df.groupby(['CompanySize']).mean()['JobSatisfaction'].sort_values()

# #### Used to Answer Question 2

df.groupby(['ProgramHobby']).mean()['JobSatisfaction'].sort_values().dropna()

df.groupby(['HomeRemote']).mean()['JobSatisfaction'].sort_values().dropna()

res = df.groupby(['FormalEducation']).mean()['JobSatisfaction'].sort_values().dropna()
res

# #### Question 1
#
# **1.** Use the space above to assist in matching each variable (**a**, **b**, **c**, **d**, **e**, **f**, **g**, or **h** ) as the appropriate key that describes the value in the **job_sol_1** dictionary.

# +
a = 0.734
b = 0.2014
c = 'full-time'
d = 'contractors'
e = 'retired'
f = 'yes'
g = 'no'
h = 'hard to tell'

job_sol_1 = {'The proportion of missing values in the Job Satisfaction column': b,
             'According to EmploymentStatus, which group has the highest average job satisfaction?': d, 
             'In general, do smaller companies appear to have employees with higher job satisfaction?': f}
             
t.jobsat_check1(job_sol_1)
# -

# #### Question 2
#
# **2.** Use the space above to assist in matching each variable (**a**, **b**, **c** ) as the appropriate key that describes the value in the **job_sol_2** dictionary. Notice you can have the same letter appear more than once.

# +
a = 'yes'
b = 'no'
c = 'hard to tell'

job_sol_2 = {'Do individuals who program outside of work appear to have higher JobSatisfaction?': a,
             'Does flexibility to work outside of the office appear to have an influence on JobSatisfaction?': a, 
             'A friend says a Doctoral degree increases the chance of having job you like, does this seem true?': a}
             
t.jobsat_check2(job_sol_2)
# -



StarcoderdataJupyterScriptsDedupFiltered