Polyglot Unconference

This notebook holds a project conducting data analysis and visualization of the 2017 Polyglot Vancouver Un-Conference.

See the README in this repository for background information.

Session 02 - "UX Battles"

This one had a much better gender dynamic and was generally more balanced, as you will see from the charts. Two hosts (who had their sessions combined) and the fact that both of them came with more questions than answers, made for a much more conversational experience. On another entirely subjective note, while you can still see that one person did speak to a much greater extent than others, his manner was friendly, supportive, and genial (as opposed to the main speaker from Session 01), but this is a diffidcult metric to track - perhaps the percentage of people that left (less here than in Session 01) is an indicator ?

Python imports


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

Reading the Data


In [3]:
# Read
data = pd.read_csv('data/2_ux.csv')

# Display
data


Out[3]:
PERSON TALKS GENDER STAYED
0 H1 12 M Y
1 H2 18 M Y
2 01 21 M Y
3 02 5 M Y
4 03 1 M Y
5 04 1 F Y
6 05 3 M Y
7 06 1 F N
8 07 1 M Y
9 08 3 F Y
10 09 1 M Y
11 10 0 M Y
12 11 0 M Y
13 12 0 M Y
14 13 0 F Y

Sanitizing the Data

As we can see, some of our data is stored in a non-numerical format which makes it difficult to perform the maths upon.

Let's clean it up.


In [4]:
# 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[4]:
PERSON TALKS GENDER STAYED
0 H1 12 0 1
1 H2 18 0 1
2 01 21 0 1
3 02 5 0 1
4 03 1 0 1
5 04 1 1 1
6 05 3 0 1
7 06 1 1 0
8 07 1 0 1
9 08 3 1 1
10 09 1 0 1
11 10 0 0 1
12 11 0 0 1
13 12 0 0 1
14 13 0 1 1

Analysis and Visualization (V1)

Let's do some really basic passes at the data before we run some mathematical computations on it, just to get a better sense of where it stands at the moment.


In [5]:
# Run Describe to give us some basic Min/Max/Mean/Std values

data.describe()


Out[5]:
TALKS
count 15.000000
mean 4.466667
std 6.854265
min 0.000000
25% 0.500000
50% 1.000000
75% 4.000000
max 21.000000

In [6]:
# Run Value_Counts in order to see some basic grouping by attribute

vc_talks = data['TALKS'].value_counts()
vc_talks


Out[6]:
1     5
0     4
3     2
5     1
12    1
21    1
18    1
Name: TALKS, dtype: int64

In [7]:
vc_gender = data['GENDER'].value_counts()
vc_gender


Out[7]:
0    11
1     4
Name: GENDER, dtype: int64

In [8]:
vc_stayed = data['STAYED'].value_counts()
vc_stayed


Out[8]:
1    14
0     1
Name: STAYED, dtype: int64

In [9]:
# Now let's do some basic plotting with MatPlotLib

data.plot()


Out[9]:
<matplotlib.axes._subplots.AxesSubplot at 0x10f5d4c50>

In [10]:
data.plot(kind='bar')


Out[10]:
<matplotlib.axes._subplots.AxesSubplot at 0x112984cf8>

In [11]:
fig1, ax1 = plt.subplots()
ax1.pie(data['TALKS'], autopct='%1.f%%', shadow=True, startangle=90)
ax1.axis('equal')
plt.show()


Analysis and Visualization (V2)

As per the methodology in the first notebook, for the sake of mapping the actual conversational flow amongst the participants, I am going to run these analyses and visualizations again while removing the hosts...


In [30]:
data_hostless = data.drop(data.index[[0,1]])

In [31]:
data_hostless.head()


Out[31]:
PERSON TALKS GENDER STAYED
2 01 21 0 1
3 02 5 0 1
4 03 1 0 1
5 04 1 1 1
6 05 3 0 1

In [32]:
data_hostless.describe()


Out[32]:
TALKS
count 13.000000
mean 2.846154
std 5.654587
min 0.000000
25% 0.000000
50% 1.000000
75% 3.000000
max 21.000000

In [33]:
dh_vc_talks = data_hostless['TALKS'].value_counts()
dh_vc_talks


Out[33]:
1     5
0     4
3     2
5     1
21    1
Name: TALKS, dtype: int64

In [34]:
dh_vc_gender = data_hostless['GENDER'].value_counts()
dh_vc_gender


Out[34]:
0    9
1    4
Name: GENDER, dtype: int64

In [35]:
dh_vc_stayed = data_hostless['STAYED'].value_counts()
dh_vc_stayed


Out[35]:
1    12
0     1
Name: STAYED, dtype: int64

In [36]:
data_hostless.plot()


Out[36]:
<matplotlib.axes._subplots.AxesSubplot at 0x1144f38d0>

In [37]:
data_hostless.plot(kind='bar')


Out[37]:
<matplotlib.axes._subplots.AxesSubplot at 0x114560b38>

In [38]:
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...

Algebraic Analysis

Now lets step into some deeper (but probaby still naive) analysis based off of my rudiemtary understanding of Data Science! :D


In [39]:
# Percentage of attendees that were silent during the talk

silent = percent_silent(data['TALKS'])
silent


Out[39]:
{'SILENT': 4, 'TOTAL': 15, 'VERBOSE': 11}

In [40]:
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 [41]:
# Percentage of attendees that left early during the talk

left = percent_left(data['STAYED'])
left


Out[41]:
{'LEFT': 1, 'STAYED': 14, 'TOTAL': 15}

In [42]:
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 [43]:
# Percentage of attendees that were Male vs. Female (see notes above around methodology)

gender = percent_gender(data['GENDER'])
gender


Out[43]:
{'FEMALE': 4, 'MALE': 11, 'TOTAL': 15}

In [44]:
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 [45]:
# Calculate Percent of Talking points by GENDER

distribution = percent_talking_gender(data[['TALKS','GENDER']])
distribution


Out[45]:
{'FEMALE': 3, 'MALE': 8, 'TOTAL': 11}

In [46]:
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()


well.... better...


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 [ ]: