This one was almost as bad as Session 01 - the conversation literally looked like a bicycle wheel, where one person spoke then Speaker 01 spoke, then someone else would speak, then Speaker 01 would respond...
At one point four women got up and left at once... it was pretty brutal. For full disclosure, I even left after 30 minutes, as I just couldn't take it anymore.
In [1]:
# Imports
import sys
import pandas as pd
import csv
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (20.0, 10.0)
In [2]:
# %load util.py
#!/usr/bin/python
# Util file to import in all of the notebooks to allow for easy code re-use
# Calculate Percent of Attendees that did not speak
def percent_silent(df):
total = len(df)
silent = 0
for row in df.iteritems():
if row[1] == 0:
silent = silent + 1
percent = {}
percent['TOTAL'] = total
percent['SILENT'] = silent
percent['VERBOSE'] = total - silent
return percent
# Calculate Percent of Attendees that left
def percent_left(df):
total = len(df)
left = 0
for row in df.iteritems():
if row[1] == 0:
left = left + 1
percent = {}
percent['TOTAL'] = total
percent['LEFT'] = left
percent['STAYED'] = total - left
return percent
# Calculate Percent of Attendees along gender
def percent_gender(df):
total = len(df)
female = 0
for row in df.iteritems():
if row[1] == 1:
female = female + 1
percent = {}
percent['TOTAL'] = total
percent['FEMALE'] = female
percent['MALE'] = total - female
return percent
# Calculate Percent of Talking points by
def percent_talking_gender(df):
total = 0
male = 0
female = 0
for talks, gender in df.itertuples(index=False):
if talks > 0:
total = total + 1
if gender == 0:
male = male + 1
elif gender == 1:
female = female + 1
percent = {}
percent['TOTAL'] = total
percent['FEMALE'] = female
percent['MALE'] = male
return percent
In [29]:
# Read
data = pd.read_csv('data/3_senior.csv')
# Display
data
Out[29]:
In [30]:
# Convert GENDER to Binary (sorry, i know...)
data.loc[data["GENDER"] == "M", "GENDER"] = 0
data.loc[data["GENDER"] == "F", "GENDER"] = 1
# Convert STAYED to 1 and Left/Late to 0
data.loc[data["STAYED"] == "Y", "STAYED"] = 1
data.loc[data["STAYED"] == "N", "STAYED"] = 0
data.loc[data["STAYED"] == "L", "STAYED"] = 0
# We should now see the data in numeric values
data
Out[30]:
In [31]:
# Run Describe to give us some basic Min/Max/Mean/Std values
data.describe()
Out[31]:
In [32]:
# Run Value_Counts in order to see some basic grouping by attribute
vc_talks = data['TALKS'].value_counts()
vc_talks
Out[32]:
In [33]:
vc_gender = data['GENDER'].value_counts()
vc_gender
Out[33]:
In [34]:
vc_stayed = data['STAYED'].value_counts()
vc_stayed
Out[34]:
In [35]:
# Now let's do some basic plotting with MatPlotLib
data.plot()
Out[35]:
In [36]:
data.plot(kind='bar')
Out[36]:
In [37]:
fig1, ax1 = plt.subplots()
ax1.pie(data['TALKS'], autopct='%1.f%%', shadow=True, startangle=90)
ax1.axis('equal')
plt.show()
In [38]:
data_hostless = data.drop(data.index[[0]])
In [39]:
data_hostless.head()
Out[39]:
In [40]:
data_hostless.describe()
Out[40]:
In [41]:
dh_vc_talks = data_hostless['TALKS'].value_counts()
dh_vc_talks
Out[41]:
In [42]:
dh_vc_gender = data_hostless['GENDER'].value_counts()
dh_vc_gender
Out[42]:
In [43]:
dh_vc_stayed = data_hostless['STAYED'].value_counts()
dh_vc_stayed
Out[43]:
In [44]:
data_hostless.plot()
Out[44]:
In [45]:
data_hostless.plot(kind='bar')
Out[45]:
In [46]:
fig1, ax1 = plt.subplots()
ax1.pie(data_hostless['TALKS'], autopct='%1.f%%', shadow=True, startangle=90)
ax1.axis('equal')
plt.show()
this is still pretty bad...
In [47]:
# Percentage of attendees that were silent during the talk
silent = percent_silent(data['TALKS'])
silent
Out[47]:
In [48]:
fig1, ax1 = plt.subplots()
sizes = [silent['SILENT'], silent['VERBOSE']]
labels = 'Silent', 'Talked'
explode = (0.05, 0)
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.0f%%', shadow=True, startangle=90)
ax1.axis('equal')
plt.show()
In [49]:
# Percentage of attendees that left early during the talk
left = percent_left(data['STAYED'])
left
Out[49]:
In [50]:
fig1, ax1 = plt.subplots()
sizes = [left['LEFT'], left['STAYED']]
labels = 'Left', 'Stayed'
explode = (0.1, 0)
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.0f%%', shadow=True, startangle=90)
ax1.axis('equal')
plt.show()
In [51]:
# Percentage of attendees that were Male vs. Female (see notes above around methodology)
gender = percent_gender(data['GENDER'])
gender
Out[51]:
In [52]:
fig1, ax1 = plt.subplots()
sizes = [gender['FEMALE'], gender['MALE']]
labels = 'Female', 'Male'
explode = (0.1, 0)
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.0f%%', shadow=True, startangle=90)
ax1.axis('equal')
plt.show()
In [53]:
# Calculate Percent of Talking points by GENDER
distribution = percent_talking_gender(data[['TALKS','GENDER']])
distribution
Out[53]:
In [54]:
fig1, ax1 = plt.subplots()
sizes = [distribution['FEMALE'], distribution['MALE']]
labels = 'Female Speakers', 'Male Speakers'
explode = (0.1, 0)
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.0f%%', shadow=True, startangle=90)
ax1.axis('equal')
plt.show()
these numbers are damning...
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: