alexa-konib-blog
alexa-konib-blog
Koala.Point Data blog
2 posts
Data Management and Visualization course.
Don't wanna be here? Send us removal request.
alexa-konib-blog · 5 years ago
Text
Task 2
Created on Sat Apr 18 15:53:37 2020
@author: Aleksandra """
#import packages for data storage and manipulation import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns
work = pd.read_csv('work1.csv',sep=";",low_memory=False)
print(len(work)) print(len(work.columns))
#Let's get summary statistics for the dataset. If not columns are easily readible, it makes sence to index specific columns. For that purpose use the toolkit outlined above. work.describe()
#regression reg=work['Region'].value_counts() print(reg)
reg=work['Region'].value_counts(normalize=True) print(reg) regression_reg=work['Region'].value_counts(normalize=True) print(regression_reg)
age=work['Age'].value_counts() print(age)
gen=work['Gender'].value_counts() print(gen)
sp=work['Sphere'].value_counts() print(sp)
mar=work['Marriage'].value_counts() print(mar)
edu=work['Education'].value_counts() print(edu)
com=work['Company_form'].value_counts() print(com)
coms=work['Company_size'].value_counts() print(coms)
pro=work['Profession'].value_counts() print(pro)
pro=work['Profession'].value_counts() print(pro)
job=work['Job_exp_manag'].value_counts() print(job)
jobcomp=work['Job_exp_cur_comp'].value_counts() print(jobcomp)
# In[34]:
#Or cross-tabulation for more than one feature. pd.crosstab(gen,com)
#To see how features of the dataset correspond to each other, use correlation matrix. We could not do this function. work.iloc[:,:70].corr()
jobcomp[::-10]
#Graphs
#define type of graph display get_ipython().run_line_magic('matplotlib', 'inline') plt.style.use('seaborn-whitegrid') plt.rcParams['figure.figsize'] = [10, 5]
# In[92]:
sns.distplot(age)
# In[93]:
sns.distplot(mar)
# In[103]:
plt.plot(work.Age,work.Marriage,'o',color="black", markersize=1) plt.xlabel("Age") plt.ylabel("Marriage") plt.title("Relation between Marriage and Age")
OUTPUT
Python 3.7.6 (default, Jan  8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] Type "copyright", "credits" or "license" for more information.
IPython 7.12.0 -- An enhanced Interactive Python.
runfile('C:/Users/flex/Documents/Python Scripts/week_1.py', wdir='C:/Users/flex/Documents/Python Scripts') 212 75 2     94 53    42 1     23 23    12 61     9 4      3 50     3 28     2 7      2 25     1 18     1 8      1 19     1 20     1 21     1 5      1 17     1 82     1 26     1 80     1 40     1 43     1 48     1 55     1 56     1 59     1 62     1 71     1 74     1 76     1 39     1 Name: Region, dtype: int64 2     0.443396 53    0.198113 1     0.108491 23    0.056604 61    0.042453 4     0.014151 50    0.014151 28    0.009434 7     0.009434 25    0.004717 18    0.004717 8     0.004717 19    0.004717 20    0.004717 21    0.004717 5     0.004717 17    0.004717 82    0.004717 26    0.004717 80    0.004717 40    0.004717 43    0.004717 48    0.004717 55    0.004717 56    0.004717 59    0.004717 62    0.004717 71    0.004717 74    0.004717 76    0.004717 39    0.004717 Name: Region, dtype: float64 2     0.443396 53    0.198113 1     0.108491 23    0.056604 61    0.042453 4     0.014151 50    0.014151 28    0.009434 7     0.009434 25    0.004717 18    0.004717 8     0.004717 19    0.004717 20    0.004717 21    0.004717 5     0.004717 17    0.004717 82    0.004717 26    0.004717 80    0.004717 40    0.004717 43    0.004717 48    0.004717 55    0.004717 56    0.004717 59    0.004717 62    0.004717 71    0.004717 74    0.004717 76    0.004717 39    0.004717 Name: Region, dtype: float64 1    90 2    44 4    27 5    26 3    25 Name: Age, dtype: int64 2    154 1     58 Name: Gender, dtype: int64 12    55 16    20 6     18 18    14 25    12 17    10 15    10 11     9 3      9 26     8 27     8 23     5 14     4 2      4 7      4 10     3 28     3 21     3 22     3 13     2 19     2 4      2 8      1 24     1 1      1 0      1 Name: Sphere, dtype: int64 3    147 1     57 2      8 Name: Marriage, dtype: int64 5    139 1     31 6     22 7     12 3      6 4      1 2      1 Name: Education, dtype: int64 1    150 2     62 Name: Company_form, dtype: int64 3    92 1    78 2    42 Name: Company_size, dtype: int64 17         42 15         21 12         20 19         16 18         14 14         13 5          11 2          11 20          7 7           7 13          6 1           6 26          6 23          5 27          4 25          4 10          3 16          3 24          3 3           3 4           2 8           2 0           1 Service     1 21          1 Name: Profession, dtype: int64 17         42 15         21 12         20 19         16 18         14 14         13 5          11 2          11 20          7 7           7 13          6 1           6 26          6 23          5 27          4 25          4 10          3 16          3 24          3 3           3 4           2 8           2 0           1 Service     1 21          1 Name: Profession, dtype: int64 0    121 4     25 1     21 3     14 2     12 5     10 6      5 8      2 7      2 Name: Job_exp_manag, dtype: int64 4    61 3    37 2    34 1    31 5    20 6    13 7    12 8     4 Name: Job_exp_cur_comp, dtype: int64
0 notes
alexa-konib-blog · 5 years ago
Text
In a nutshel
Task 1: Getting Your Research Project Started
Data Management and Visualization, week 1
This project is a part of my course paper.Together with my groupmate we are working on it. The main purpose was to explore the relationship between the big five personality traits, employee engagement, and both job and life satisfaction. We conducted a survey. I will analyze the data set that  we gathered via survey. 
The second part is about happiness of employees.We will conduct the interviews to investigate it. 
Research questions and hypotheses are:
1. Do personality factors influence life and job satisfaction directly or mediated by p-o fit?  H 1: P-O fit mediates the relationship between personality traits and life and job satisfaction.
2. Do personality factors influence job satisfaction directly or mediated by life satisfaction?  H2: Life satisfaction mediates the relationship between personality traits and job satisfaction.                                                                                       
3. Do personality factors influence work engagement directly or mediated by life satisfaction? H3: Life satisfaction mediates the relationship between personality traits and work engagement.
We have a big literature review, as an example a part from it:
Templer (2012) in his research notiсed the importance of such Big Five personality traits as extraversion, agreeableness, conscientiousness, and neuroticism because they were in strong relation with job satisfaction.
References: Templer, K. J. (2012). Five‐factor model of personality and job satisfaction: The importance of agreeableness in a tight and collectivistic Asian society. Applied Psychology, 61(1), 114-129.
1 note · View note