In [1]:
%matplotlib inline
import sys # system module
import numpy as np # scientific computing
import pandas as pd # data package
import matplotlib as mpl
import matplotlib.pyplot as plt # graphics module
Whether it is the women’s march, or the ‘fearless girl’ status staring down Wall Street’s bull, there has been a national conversation on women’s rights and gender equality. As aspiring female professionals, gender diversity in the workplace is an important personal priority for us. Clearly there’s important work to be done, and this starts with a greater awareness of the problems.
In Part I, we decided to look at the different ways men and women inhabit the world of work. Also, we often hear working mothers say they worry about balancing work and family, suggesting they expect to face more challenges than their male counterparts or are doing a different cost-benefit analysis. In Part II, we explore the link between women's work commitments and their family commitments, and lastly recommend what can be done to improve equality.
In [5]:
#Step 1: Input Data
import pandas as pd #Use pandas to read data into Python from our computers.
path = '/Users/Haley/Desktop/Final_Project_Data.xlsx' #Read data with the complete path
sheet1 = pd.read_excel(path,
sheetname='Civilian Labor Force by Sex',
skip_footer =7,
index_col = 0)
print('Data types:\n\n', sheet1.dtypes,sep='')
print('Dimensions:', sheet1.shape)
sheet1.head()
Out[5]:
In [6]:
#Step 2: Draw graphs
fig, ax = plt.subplots(2, 1, figsize=(8,8)) # create fig and ax objects
sheet11 = sheet1[['Number of women in the civilian labor force (in thousands)',
'Number of men in the civilian labor force (in thousands)']]
sheet11.plot(ax=ax[0],
kind='line', # line plot
color=['red', 'green'], # line color
alpha=0.65)
ax[0].legend(['Number of women in the civilian labor force',
'Number of men in the civilian labor force'],
fontsize=8,
loc=0)
ax[0].set_ylabel('Number in the civlian force in thousands')
ax[0].set_xlabel('Date')
ax[0].set_ylim(0)
ax[0].set_title('Civilian Labor Force by Sex (1948-2015)', fontsize=14, loc='left')
sheet12=sheet1[['Share of the civilian labor force who are women (percent)',
'Share of the civilian labor force who are men (percent)']]
sheet12.plot(ax=ax[1],
kind='line', # line plot
color=['red', 'green'], # line color
alpha=0.65)
ax[1].legend(['% of women in the civilian labor force',
'% of men in the civilian labor force'],
fontsize=8,
loc=0)
ax[1].set_ylabel('% in the civlian force')
ax[1].set_xlabel('Date')
ax[1].set_ylim(0)
ax[0].spines["top"].set_visible(False)
ax[0].spines["bottom"].set_visible(False)
ax[0].spines["right"].set_visible(False)
ax[0].spines["left"].set_visible(False)
ax[1].spines["top"].set_visible(False)
ax[1].spines["bottom"].set_visible(False)
ax[1].spines["right"].set_visible(False)
ax[1].spines["left"].set_visible(False)
Based on the data analysis above, we are glad to see women account for nearly half of the U.S. labor force. In 1948, 28.6% of the labor force at the time with ages 16 and older were women. That share rose steadily and peaked at 46.9% in 2012. As of 2015 (the most recent data available provided by the Women's Bureau, U.S. Department of Labor), 46.8% of women were in the labor force, only 6.4 percentage points lower than the share for men (53.2%).
In [7]:
#Step 1: Input Data
sheet2 = pd.read_excel(path,
sheetname='Labor Force Participation Rate',
skiprows = 1,
index_col = 0,
usecols =(range(3)) #only need the first three cols
)
sheet2
Out[7]:
In [9]:
#Step 2: Draw a graph
plt.plot(sheet2.index, sheet2['All Women'])
plt.plot(sheet2.index, sheet2['All Men'])
plt.title('Labor Force Partipation Rate by Sex', fontsize=14, loc='left') # add title
plt.ylabel('Labor Force Participation Rate') # y axis label
plt.xlabel('Year') # y axis label
Out[9]:
In [10]:
#Step 1: Input Data
sheet3 = pd.read_excel(path,
sheetname='Median annual earnings by sex',
skiprows = 2,
index_col = 0,
usecols =(range(3)) #only need the first three cols
)
sheet3
#To do list
#Draw a line graph
#calculate the difference in year 1960 and the difference in year 2014
Out[10]:
In [11]:
#Step 2: Draw a graph
sheet3.plot(title='Median Annual Earnings by Sex', color=['r','g'])
Out[11]:
Given the graph above, we can see females had historically been consistently paid less than our male conterparts. While the gap has narrowed, the median annual earnings by women is still around $10,000 less than those of men. Sadly, men had outearned women since 1960, this is still the case TODAY.
In [14]:
#Step 1: Input Data
sheet4 = pd.read_excel(path,
sheetname='Participation Rate by Edu Sex',
skip_footer = 6,
index_col = 0
)
sheet4=sheet4[['Women','Men']]
In [15]:
#Step 2: Draw a graph
sheet4.plot(figsize=(17,6), ylim=(0,100), kind='bar', color=['red','g'],alpha=0.5,
title='Participation Rate by Edu Sex')
Out[15]:
Given the bar chart, we can see that in each category, women are less likely to be employed or actively looking for jobs even when we have similar levels of education compared to our male counterparts.
Only 32.3% of women who have less than a high school diploma work, while 58.3% of men with the same level of education do. Even at the top, 72.2% of women that have advanced degrees including master, professioanl or doctoral degrees work, yet 77.8% of men in the same category work.
What is preventing the 5.6% of women that are just as intelligent, capable and competent from performing work and holding positions? What is holding them back? This brings us to the next possible reason.
Again, the insight we derived from the previous section tells us that even when men and women have similar levels of education, women are less likely to be employed or actively looking for jobs. We ask: Why is it that at every level of education, women fall behind in terms of participation in the labor force?
We often hear women say they worry about balancing work and family, suggesting they expect to face more challenges than their male counterparts or are doing a different cost-benefit analysis.
What we would like to focus on in the scope of this analysis is the link between women's work commitments and their family comitments.
Women do the majority of housework and child care. We ask: at every stage in their careers, do women still perform more housework and childcare than men? Is there a link between the amount of work women do at home and their career ambition? In order to uncover insights, we explore the following datasets below:
In [16]:
#Step 1: Input Data
sheet5 = pd.read_excel(path,
sheetname='Employed parents by status',
skip_footer = 4,
skiprows=1,
index_col = 0,
#usecols=['Age of youngest child','Percent of total employed of mothers','Percent of total employed of fathers']
# sheet5["Type"] == 'Full-time'
)
sheet16 = sheet5[sheet5['Type'] == 'Full-time']
sheet16
Out[16]:
In [17]:
sheet17 = sheet5[sheet5['Type'] == 'Part-time']
sheet17
Out[17]:
In [29]:
fig, ax = plt.subplots(2, 1, figsize=(14,14)) # create fig and ax objects
sheet16.plot(ax=ax[0],
kind='bar', # line plot
color=['purple', 'yellow'], # line color
alpha=0.5, width=0.4)
ax[0].legend(['Mothers',
'Fathers'],
fontsize=10,
loc='center')
ax[0].set_ylabel('Percent of total employed')
ax[0].set_xlabel('Age of youngest child')
ax[0].set_ylim(0)
ax[0].set_title('Employed parents by full-time status, sex and age of youngest child, 2015 annual averages', fontsize=10, loc='left')
sheet17.plot(ax=ax[1],
kind='bar', # line plot
color=['purple', 'yellow'], # line color
alpha=0.5, width=0.4)
ax[1].legend(['Mothers',
'Fathers'],
fontsize=10,
loc='center')
ax[1].set_ylabel('Percent of total employed')
ax[1].set_xlabel('Age of youngest child')
ax[1].set_ylim(0)
ax[1].set_title('Employed parents by part-time status, sex and age of youngest child, 2015 annual averages', fontsize=10, loc='left')
ax[0].spines["top"].set_visible(False)
ax[0].spines["right"].set_visible(False)
ax[0].spines["left"].set_visible(False)
ax[1].spines["top"].set_visible(False)
ax[1].spines["left"].set_visible(False)
In [28]:
fig, ax = plt.subplots(figsize=(12,4))
sheet16.plot(ax=ax,
kind='bar', # line plot
color=['purple', 'yellow'], # line color
alpha=0.5, width=0.4)
ax.set_ylabel('Employment rates')
ax.set_xlabel('Age of the youngest child')
ax.set_ylim(0)
ax.set_title('Employment Rate of parents', fontsize=14)
ax.legend(fontsize=8,
loc=0)
ax.spines["top"].set_visible(False)
The younger the child is, the more time that mothers seem to dedicate to the family. Most mothers begin to switch back into full-time employment as their child ages; however, once the children reach the age of college, mothers tend to pick lighter workload again. This shows that mothers are usually the ones in the family who change career paths to cater to the needs of the family.
In [4]:
#Step 1: Input Data
sheet6 = pd.read_excel(path,
sheetname='Unemployment Rate of parents',
skip_footer = 4,
index_col = 0)
sheet6
Out[4]:
In [8]:
#Step 2: Draw a graph
fig, ax = plt.subplots(figsize=(12,4))
sheet6.plot(ax=ax,
kind='bar', # line plot
color=['purple', 'yellow'], # line color
alpha=0.5, width=0.4)
ax.set_ylabel('Unemployment rates')
ax.set_xlabel('Age of the youngest child')
ax.set_ylim(0)
ax.set_title('Unemployment Rate of parents', fontsize=14)
ax.legend(fontsize=8,
loc=0)
ax.spines["top"].set_visible(False)
#if column == "under 3 years":
# y_pos += 0.5
We can derive the following insights from the graph above:
In [30]:
#Step 1: Import Data
sheet7 = pd.read_excel(path,
sheetname='Table 8B Important',
skiprows = 3,
skip_footer = 4,
index_col = 0)
sheet71=sheet7[['Men.1','Women.1']]
sheet71 = sheet71.rename(columns={'Men.1': 'Men', 'Women.1': 'Women'})
sheet71=sheet71.iloc[[4, 5, 6, 13, 12,16], :]
sheet71
Out[30]:
In [31]:
#Step 2: Draw a graph
fig, ax = plt.subplots(figsize=(12,4))
sheet71.plot(ax=ax,
kind='bar', # line plot
color=['purple', 'yellow'], # line color
alpha=0.5, width=0.4)
ax.set_ylabel('Average Hours per Day ')
ax.set_ylim(0)
ax.set_title('American Use of Time by Sex When the Youngest Child is Under 6', fontsize=14)
ax.legend(['Men', 'Women'],fontsize=8,
loc='best')
ax.spines["top"].set_visible(False)
In [32]:
#Step 1: Import Data
sheet7 = pd.read_excel(path,
sheetname='Table 8B Important',
skiprows = 3,
skip_footer = 4,
index_col = 0)
sheet72=sheet7[['Men.2','Women.2']]
sheet72 = sheet72.rename(columns={'Men.2': 'Men', 'Women.2': 'Women'})
sheet72=sheet72.iloc[[4, 5, 6, 13, 12,16], :]
sheet72
Out[32]:
In [33]:
#Step 2: Draw a graph
fig, ax = plt.subplots(figsize=(12,4))
sheet72.plot(ax=ax,
kind='bar', # line plot
color=['purple', 'yellow'], # line color
alpha=0.5, width=0.4)
ax.set_ylabel('Average Hours per Day ')
ax.set_ylim(0)
ax.set_title('American Use of Time by Sex When the Youngest Child is Between 6 to 17', fontsize=14)
ax.legend(['Men', 'Women'],fontsize=8,
loc='best')
ax.spines["top"].set_visible(False)
Even though gender inequality seems to have improved over the past decades, the expection on women taking care of the family still perpetuates in the society. Voluntarily or relunctantly, women change their career path for the needs of the family which means that they naturally have a lower chance to achieve the equal amount of success as men. At every stage in their careers, women do more housework and child care than men—and there appears to be a link between the amount of work people do at home and their career ambition. We can conclude that the more work mothers do at home, the less interested they are in maintaining or succeeding in a career.
Each one of us has an important role to play, from talking more often and openly about gender diversity to modeling our commitment in our everyday actions. Our research confirmed the notion that women have long been viewed as the caretakers in the families and there is a negative correlation between the amount of housework they do and the amount of success they achieve in the workplace. Our recommendation is that fostering equality is not always about making big gestures, it could start right at the comfort of one's home by having men perform their fair share of housework.