manipulate_regonline_output

This notebook reads the RegOnline output into a pandas DataFrame and reworks it to have each row contain the attendee, the Doppler Primer Session, the Monday Breakout session, and the Tuesday breakout session in each row.


In [1]:
import re
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib

In [2]:
#%matplotlib inline

Read the RegOnline output into a pandas DataFrame


In [112]:
df = pd.read_excel('/Users/matt/projects/EPRV/data/AttendeeReportCrop_20150703.xls', encoding='utf-8')

In [113]:
df.columns


Out[113]:
Index([u'AgendaItem', u'RegId', u'GroupId', u'FirstName', u'LastName', u'Company'], dtype='object')

In [114]:
df.loc[36:37]


Out[114]:
AgendaItem RegId GroupId FirstName LastName Company
36 Doppler Primer: Instrumentation Challenges 78650013 78650013 Rebekah Dawson UC Berkeley
37 Doppler Primer: Spot Modeling 78698289 78698289 Fabio Del Sordo Yale / NORDITA

Extract the Sunday Sessions

RegOnline outputs multiple entries for each person, and each entry differs by the AgendaItem. AgendaItems exist for all sessions happening on all days. In this section, we extract the sessions happening on Sunday, which are all prefixed by "Doppler Primer: ".


In [115]:
sundf = df[df['AgendaItem'].str.contains('Doppler Primer:')].copy()
len(sundf)


Out[115]:
126

Let's create two new columns in our DataFrame: the Primer, and the PrimerID. The Primer column will contain the name of the Doppler Primer session (minus the Doppler Primer: prefix), and the PrimerID will be a session identifier that will later be used in plotting.


In [116]:
sundf['PrimerID'] = 0

In [117]:
sundf['Primer'] = [re.search(r'(.*):\s(.*)$', item).group(2) for item in sundf['AgendaItem']]

In [118]:
sundf[['AgendaItem', 'Primer']].head(3)


Out[118]:
AgendaItem Primer
0 Doppler Primer: Instrumentation Challenges Instrumentation Challenges
1 Doppler Primer: Doppler code Doppler code
2 Doppler Primer: Spot Modeling Spot Modeling

In [119]:
sundf['Primer'].unique()


Out[119]:
array([u'Instrumentation Challenges', u'Doppler code', u'Spot Modeling',
       u'Statistical Analysis', u'Not Attending'], dtype=object)

Now loop through the five unique sessions, updating the PrimerID column for each participant:


In [120]:
dopID = 0
for agItem in sundf['Primer'].unique():
    sundf.loc[sundf['Primer'] == agItem, 'PrimerID'] = dopID
    dopID += 1

Create an abbreviated code for each session. This will be added to the nametag to spark conversation among participants.


In [121]:
sun_ses = ['IC', 'DC', 'SM', 'SA', 'NA']

A quick preview of the first few rows to see the result:


In [122]:
sundf[['AgendaItem', 'Primer', 'PrimerID']].head(4)


Out[122]:
AgendaItem Primer PrimerID
0 Doppler Primer: Instrumentation Challenges Instrumentation Challenges 0
1 Doppler Primer: Doppler code Doppler code 1
2 Doppler Primer: Spot Modeling Spot Modeling 2
3 Doppler Primer: Spot Modeling Spot Modeling 2

Extract the Monday Sessions

Now to do the same for the Monday sessions.


In [123]:
mondf = df[df['AgendaItem'].str.contains('Monday Break-out:')].copy()
len(mondf)


Out[123]:
135

In [124]:
mondf['MonID'] = 0

mondf['Monday'] = [re.search(r'(.*):\s(.*)$', item).group(2) for item in mondf['AgendaItem']]

mondf['Monday'].unique()

monID = 0
for agItem in mondf['Monday'].unique():
    mondf.loc[mondf['Monday'] == agItem, 'MonID'] = monID
    monID += 1

In [125]:
mondf['Monday'].unique()


Out[125]:
array([u'Fiber Optic Scrambling', u'Not attending',
       u'Telluric Contamination', u'Barycentric Corrections',
       u'Frequency Comb Calibrators'], dtype=object)

In [126]:
mon_ses = ['FS', 'NA', 'TC', 'BC', 'FC']

In [127]:
mondf[['AgendaItem', 'Monday', 'MonID']].head(4)


Out[127]:
AgendaItem Monday MonID
126 Monday Break-out: Fiber Optic Scrambling Fiber Optic Scrambling 0
127 Monday Break-out: Not attending Not attending 1
128 Monday Break-out: Fiber Optic Scrambling Fiber Optic Scrambling 0
129 Monday Break-out: Telluric Contamination Telluric Contamination 2

Extract Tuesday Sessions


In [128]:
tuedf = df[df['AgendaItem'].str.contains('Tuesday Break-out:')].copy()
len(tuedf)


Out[128]:
135

In [129]:
tuedf['TueID'] = 0

tuedf['Tuesday'] = [re.search(r'(.*):\s(.*)$', item).group(2) for item in tuedf['AgendaItem']]

tuedf['Tuesday'].unique()

tuesID = 0
for agItem in tuedf['Tuesday'].unique():
    tuedf.loc[tuedf['Tuesday'] == agItem, 'TueID'] = tuesID
    tuesID += 1

In [130]:
tuedf['Tuesday'].unique()


Out[130]:
array([u'Statistical techniques', u'Detection Threshold Criteria',
       u'Line Bisectors and decorrelatio', u'Photospheric Signals',
       u'Not attending'], dtype=object)

In [131]:
tue_ses = ['ST', 'DC', 'LB', 'PS', 'NA']

In [132]:
tuedf[['AgendaItem', 'Tuesday', 'TueID']].head(4)


Out[132]:
AgendaItem Tuesday TueID
261 Tuesday Break-out: Statistical techniques Statistical techniques 0
262 Tuesday Break-out: Statistical techniques Statistical techniques 0
263 Tuesday Break-out: Detection Threshold Criteria Detection Threshold Criteria 1
264 Tuesday Break-out: Detection Threshold Criteria Detection Threshold Criteria 1

Combine the DataFrames

We only need to join on one field. However, pandas does something weird, where it creates multiple GroupId_x columns when joining multiple times. The simple solution is just to join on multiple columns since we know they're all consistent.


In [133]:
fulldf = df[['RegId', 'GroupId', 'FirstName', 'LastName', 'Company']]

In [134]:
print(len(fulldf))
fulldf = fulldf.drop_duplicates()
print(len(fulldf))
print(len(sundf))
print(len(mondf))
print(len(tuedf))


396
137
126
135
135

In [135]:
fulldf.columns


Out[135]:
Index([u'RegId', u'GroupId', u'FirstName', u'LastName', u'Company'], dtype='object')

In [136]:
sundf.columns


Out[136]:
Index([u'AgendaItem', u'RegId', u'GroupId', u'FirstName', u'LastName', u'Company', u'PrimerID', u'Primer'], dtype='object')

In [137]:
newdf = pd.merge(fulldf, sundf, on=['RegId', 'GroupId', 'FirstName', 'LastName', 'Company'], how='left')
print(len(newdf))

newdf = pd.merge(newdf, mondf, on=['RegId', 'GroupId', 'FirstName', 'LastName', 'Company'], how='left')
print(len(newdf))

newdf = pd.merge(newdf, tuedf, on=['RegId', 'GroupId', 'FirstName', 'LastName', 'Company'], how='left')
print(len(newdf))


137
137
137

In [138]:
newdf.head(5)


Out[138]:
RegId GroupId FirstName LastName Company AgendaItem_x PrimerID Primer AgendaItem_y MonID Monday AgendaItem TueID Tuesday
0 79762584 79762584 Arthur Adams Yale University Doppler Primer: Instrumentation Challenges 0 Instrumentation Challenges Monday Break-out: Fiber Optic Scrambling 0 Fiber Optic Scrambling Tuesday Break-out: Statistical techniques 0 Statistical techniques
1 79809320 79809320 Guillem Anglada-Escude Queen Mary University of London/University of ... Doppler Primer: Doppler code 1 Doppler code Monday Break-out: Fiber Optic Scrambling 0 Fiber Optic Scrambling Tuesday Break-out: Detection Threshold Criteria 1 Detection Threshold Criteria
2 80253872 80253872 Ruth Angus University of Oxford/Harvard-Smithsonian Cente... Doppler Primer: Spot Modeling 2 Spot Modeling Monday Break-out: Telluric Contamination 2 Telluric Contamination Tuesday Break-out: Detection Threshold Criteria 1 Detection Threshold Criteria
3 78665380 78665380 Pamela Arriagada DTM, CIW Doppler Primer: Spot Modeling 2 Spot Modeling Monday Break-out: Barycentric Corrections 3 Barycentric Corrections Tuesday Break-out: Line Bisectors and decorrel... 2 Line Bisectors and decorrelatio
4 78665381 78665381 Mariona Badenas Yale University Doppler Primer: Statistical Analysis 3 Statistical Analysis Monday Break-out: Barycentric Corrections 3 Barycentric Corrections Tuesday Break-out: Line Bisectors and decorrel... 2 Line Bisectors and decorrelatio

In [139]:
newdf.columns


Out[139]:
Index([u'RegId', u'GroupId', u'FirstName', u'LastName', u'Company', u'AgendaItem_x', u'PrimerID', u'Primer', u'AgendaItem_y', u'MonID', u'Monday', u'AgendaItem', u'TueID', u'Tuesday'], dtype='object')

Now create a new DataFrame that is a subset of the newdf with only the columns of interest. Also, make sure the DataFrame is sorted by lastname, the index is reset, and it's a copy of newdf instead of a pointer to newdf.


In [140]:
finaldf = newdf[['FirstName', 'LastName', 'Company', 'Primer', 'PrimerID', 'Monday', 'MonID', 'Tuesday', 'TueID']].sort('LastName').reset_index().copy()

In [141]:
finaldf.head(5)


Out[141]:
index FirstName LastName Company Primer PrimerID Monday MonID Tuesday TueID
0 0 Arthur Adams Yale University Instrumentation Challenges 0 Fiber Optic Scrambling 0 Statistical techniques 0
1 126 Rachel Akeson NASA Exoplanet Science Institute NaN NaN Not attending 1 Statistical techniques 0
2 1 Guillem Anglada-Escude Queen Mary University of London/University of ... Doppler code 1 Fiber Optic Scrambling 0 Detection Threshold Criteria 1
3 2 Ruth Angus University of Oxford/Harvard-Smithsonian Cente... Spot Modeling 2 Telluric Contamination 2 Detection Threshold Criteria 1
4 3 Pamela Arriagada DTM, CIW Spot Modeling 2 Barycentric Corrections 3 Line Bisectors and decorrelatio 2

In [142]:
len(finaldf)


Out[142]:
137

In [143]:
finaldf.columns


Out[143]:
Index([u'index', u'FirstName', u'LastName', u'Company', u'Primer', u'PrimerID', u'Monday', u'MonID', u'Tuesday', u'TueID'], dtype='object')

Now replace all empty cells for "Company" to a very general location:


In [144]:
finaldf.Company = ['Earth' if pd.isnull(company_el) else company_el for company_el in finaldf.Company]

Replace NaNs for PrimerID with the "Not Attending" ID:


In [145]:
finaldf.PrimerID = [4 if pd.isnull(primerid_el) else primerid_el for primerid_el in finaldf.PrimerID]

Check for NaNs in the Monday ID:


In [146]:
len(finaldf[pd.isnull(finaldf['MonID'])])


Out[146]:
2

Replace NaNs for the MonID with the "Not Attending" ID:


In [147]:
finaldf.MonID = [4 if pd.isnull(monid_el) else monid_el for monid_el in finaldf.MonID]

In [148]:
len(finaldf[pd.isnull(finaldf['MonID'])])


Out[148]:
0

Replace NaNs for the TueID with the "Not Attending" ID:


In [149]:
len(finaldf[pd.isnull(finaldf['TueID'])])


Out[149]:
2

In [150]:
finaldf.TueID = [4 if pd.isnull(tueid_el) else tueid_el for tueid_el in finaldf.TueID]

In [151]:
len(finaldf[pd.isnull(finaldf['TueID'])])


Out[151]:
0

Test out the wrap-around text for institute for participants that have long institution names. This regular expression will look for institutions (or Companies, as RegOnline refers to them), and find items that have a '/', and if no '/', either a '-', ',', or 'at' in the text. If so, add a newline character to make the text wrap around to the next line.

We'll first test the output on a participant's institution that contains both a '/' and a '-':


In [152]:
p = re.compile ('(/|^(?!.*/).*-|^(?!.*/).*,|^(?!.*/).*\sat\s)')
p.subn(r'\1\n', finaldf.loc[2].Company)[0]


Out[152]:
u'Queen Mary University of London/\nUniversity of Herfordshire'

And test a cell that is long, contains at, but at is part of a longer word:


In [153]:
p.subn(r'\1\n', finaldf.loc[53].Company)[0]


Out[153]:
u'The Ohio State University'

And a quick test on a few more institutions:


In [154]:
[p.sub(r'\1\n', company_el) if len(company_el) > 30 else company_el for company_el in finaldf.head(5).Company.values]


Out[154]:
[u'Yale University',
 u'NASA Exoplanet Science Institute',
 u'Queen Mary University of London/\nUniversity of Herfordshire',
 u'University of Oxford/\nHarvard-Smithsonian Center for Astrophysics',
 u'DTM, CIW']

Now update the full Company column of the DataFrame:


In [155]:
finaldf.Company = [p.sub(r'\1\n', company_el) if len(company_el) > 30 else company_el for company_el in finaldf.Company.values]

Plot Labels

Now that we have our DataFrame cleaned up the way we want it we can print the data to the Avery 5392 format. This format contains 6 4"x3" nametags per sheet.


In [156]:
png = mpimg.imread('/Users/matt/projects/EPRV/images/NameTag2.png')

In [157]:
png.shape


Out[157]:
(900, 1200, 4)

In [158]:
import matplotlib.font_manager as mfm
fontpaths = fontpaths=['/System/Library/Fonts/',
                       '/Library/Fonts',
                       '/Library/Fonts/Microsoft',
                       '/usr/X11/lib/X11/fonts',
                       '/opt/X11/share/fonts',
                       '/Users/matt/Library/Fonts']

blaa = mfm.findSystemFonts(fontpaths=fontpaths)

In [159]:
colors = ['#FFE2A9', '#4BA4D8', '#768085', '#BF5338', '#335B8F']
colors2 = ['#335B8F', '#BF5338', '#768085',  '#4BA4D8', '#FFE2A9']
colors3 = ['#4BA4D8', '#FFE2A9', '#BF5338', '#768085', '#335B8F']

circ_ypos = 775
name_dict = {'family': 'YaleNew-Roman',
             'color': '#D6E8E1',
             'weight': 'bold',
             'size': 28
             }

company_dict = {'family': 'YaleNew-Roman',
                'color': '#D6E8E1',
                'weight': 'bold',
                'size': 16
                }

circle_dict = {'family': 'YaleNew-Roman',
               'color': '#1D2523',
               'weight': 'normal',
               'size': 20
               }


def change_name_size(name, name_dict):
    if len(name) < 16:
        name_dict['size'] = 28
    elif ((len(name) >= 16) and (len(name) < 19)):
        name_dict['size'] = 24
    elif ((len(name) >= 19) and (len(name) < 24)):
        name_dict['size'] = 20
    elif ((len(name) >= 24) and (len(name) < 30)):
        name_dict['size'] = 17
    else:
        name_dict['size'] = 16
    return name_dict
        

def change_company_size(company, company_dict):
    newlines = len(re.findall(r'\n', finaldf.loc[0].Company))
    if newlines == 0:
        if len(company) < 15:
            company_dict['size'] = 18
        elif ((len(company) >= 15) and (len(company) < 30)):
            company_dict['size'] = 14
        elif ((len(company) >= 30) and (len(company) < 40)):
            company_dict['size'] = 12
        elif ((len(company) >= 40) and (len(company) < 50)):
            company_dict['size'] = 10
        else:
            company_dict['size'] = 8
    else:
        if len(company) < 15:
            company_dict['size'] = 18
        elif ((len(company) >= 15) and (len(company) < 40)):
            company_dict['size'] = 14
        elif ((len(company) >= 40) and (len(company) < 50)):
            company_dict['size'] = 12
        else:
            company_dict['size'] = 10
    return company_dict
    

# The HP Color LaserJet CP4020 offsets things by 1/16th of an inch left-to-right.
# This fudge factor should fix that:
hrz_fdg = 1. / 16./ 8.5
leftarr = np.array([0.0294, 0.5, 0.0294, 0.5, 0.0294, 0.5]) + hrz_fdg
bottomarr = [0.091, 0.091, 0.364,  0.364, 0.637, 0.637]
width = 0.4706
height = 0.273

# loop through the total number of pages:
for page in range(int(np.ceil((len(finaldf))/6.))):
    print('Now on page: {}'.format(page))
    fig = plt.figure(figsize=(8.5, 11))
    for indx in range(6):
        # add an if statement to handle the last page if there are less than
        # six participants remaining:
        if ((page*6 + indx) < len(finaldf)):
            rect = [leftarr[indx], bottomarr[indx], width, height]
            ax = fig.add_axes(rect)
            ax.imshow(png)
            ax.get_xaxis().set_visible(False)
            ax.get_yaxis().set_visible(False)

            print(u'Now making name tag for: {} {}'.format(finaldf.loc[page*6 + indx].FirstName, finaldf.loc[page*6 + indx].LastName))
            
            #add name text:
            name = finaldf.loc[page*6 + indx].FirstName + ' ' + finaldf.loc[page*6 + indx].LastName 
            this_name_dict = change_name_size(name, name_dict)
            ax.text(600, 500, name, fontdict=this_name_dict, horizontalalignment='center')

            #add company text:
            company = finaldf.loc[page*6 + indx].Company
            this_co_dict = change_company_size(company, company_dict)
            ax.text(600, 625, company, fontdict=this_co_dict, horizontalalignment='center')

            #add circles for sessions:
            circ1 = plt.Circle((750, circ_ypos), 70, color=colors[int(finaldf.loc[page*6 + indx].PrimerID)])
            fig.gca().add_artist(circ1)
            ax.text(750, circ_ypos + 27.5, sun_ses[int(finaldf.loc[page*6 + indx].PrimerID)], fontdict=circle_dict, horizontalalignment='center')

            circ2 = plt.Circle((925, circ_ypos), 70, color=colors2[int(finaldf.loc[page*6 + indx].MonID)])
            fig.gca().add_artist(circ2)
            ax.text(925, circ_ypos + 27.5, mon_ses[int(finaldf.loc[page*6 + indx].MonID)], fontdict=circle_dict, horizontalalignment='center')

            circ3 = plt.Circle((1100, circ_ypos), 70, color=colors3[int(finaldf.loc[page*6 + indx].TueID)])
            fig.gca().add_artist(circ3)
            ax.text(1100, circ_ypos + 27.5, tue_ses[int(finaldf.loc[page*6 + indx].TueID)], fontdict=circle_dict, horizontalalignment='center')

    plt.savefig('../nametags/nameTags_bold_p'+str(page)+'.png', dpi=300)


Now on page: 0
Now making name tag for: Arthur Adams
Now making name tag for: Rachel Akeson
Now making name tag for: Guillem Anglada-Escude
Now making name tag for: Ruth Angus
Now making name tag for: Pamela Arriagada
Now making name tag for: Mariona Badenas
Now on page: 1
Now making name tag for: Roman Baluev
Now making name tag for: Fabienne Bastien
Now making name tag for: Ozgur Basturk
Now making name tag for: Sarbani Basu
Now making name tag for: Florian Bauer
Now making name tag for: Jacob Bean
Now on page: 2
Now making name tag for: Thomas Beatty
Now making name tag for: Eric Bechter
Now making name tag for: Megan Bedell
Now making name tag for: Sagi Ben-Ami
Now making name tag for: Cullen Blake
Now making name tag for: Andreas Boesch
Now on page: 3
Now making name tag for: Adam Bolton
Now making name tag for: Francesco Borsa
Now making name tag for: Francois Bouchy
Now making name tag for: Brendan Bowler
Now making name tag for: Tabetha Boyajian
Now making name tag for: John Brewer
Now on page: 4
Now making name tag for: Lars A. Buchhave
Now making name tag for: Jennifer Burt
Now making name tag for: Richard Capps
Now making name tag for: Maria Federica Cersullo
Now making name tag for: Abhijit Chakraborty
Now making name tag for: Jessi Cisewski
Now on page: 5
Now making name tag for: William Cochran
Now making name tag for: Uriel Conod
Now making name tag for: Matthew Cornachione
Now making name tag for: Justin Crepp
Now making name tag for: Mario Damasso
Now making name tag for: Allen Davis
Now on page: 6
Now making name tag for: Rebekah Dawson
Now making name tag for: Fabio Del Sordo
Now making name tag for: Rodrigo Diaz
Now making name tag for: Scott Diddams
Now making name tag for: Courtney Dressing
Now making name tag for: Xavier Dumusque
Now on page: 7
Now making name tag for: Jason Eastman
Now making name tag for: Michael Endl
Now making name tag for: João Faria
Now making name tag for: Tobias Feger
Now making name tag for: Pedro Figueira
Now making name tag for: Debra Fischer
Now on page: 8
Now making name tag for: Eric Ford
Now making name tag for: Daniel Foreman-Mackey
Now making name tag for: BJ Fulton
Now making name tag for: Gabor Furesz
Now making name tag for: Peter Gao
Now making name tag for: Bernard Gaudi
Now on page: 9
Now making name tag for: Matteo Genoni
Now making name tag for: Paolo Giacobbe
Now making name tag for: Matt Giguere
Now making name tag for: Steve Girvin
Now making name tag for: Erica Gonzales
Now making name tag for: Frank Grundahl
Now on page: 10
Now making name tag for: Guillaume HEBRARD
Now making name tag for: Sam Halverson
Now making name tag for: Artie Hatzes
Now making name tag for: Raphaelle Haywood
Now making name tag for: Guillaume Hebrard
Now making name tag for: Enrique Herrero
Now on page: 11
Now making name tag for: David Hogg
Now making name tag for: Joshua Hopgood
Now making name tag for: Andrew Howard
Now making name tag for: John Johnson
Now making name tag for: Paul Jorden
Now making name tag for: Colby Jurgenson
Now on page: 12
Now making name tag for: Marco Landoni
Now making name tag for: Antonino Francesco Lanza
Now making name tag for: David Latham
Now making name tag for: Gregory Laughlin
Now making name tag for: Christophe Lovis
Now making name tag for: Zaira M. Berdiñas
Now on page: 13
Now making name tag for: Bo Ma
Now making name tag for: Gregory Mace
Now making name tag for: Suvrath Mahadevan
Now making name tag for: Luca Malavolta
Now making name tag for: Rosemary Mardling
Now making name tag for: Tyler McCracken
Now on page: 14
Now making name tag for: Nate McCrady
Now making name tag for: Michael Mossman
Now making name tag for: Ati Motalebi
Now making name tag for: Claire Moutou
Now making name tag for: Benjamin Nelson
Now making name tag for: Grzegorz Nowak
Now on page: 15
Now making name tag for: Nikhil Padmanabhan
Now making name tag for: Hannu Parviainen
Now making name tag for: Francesco Pepe
Now making name tag for: Mario Perez
Now making name tag for: David Phillips
Now making name tag for: Peter Plavchan
Now on page: 16
Now making name tag for: Lisa Prato
Now making name tag for: Sam Quinn
Now making name tag for: Andreas Quirrenbach
Now making name tag for: Jayadev Rajagopal
Now making name tag for: Vinesh Rajpaul
Now making name tag for: Gert Raskin
Now on page: 17
Now making name tag for: Ansgar Reiners
Now making name tag for: Paul Robertson
Now making name tag for: Albert Rosich
Now making name tag for: Arpita Roy
Now making name tag for: Nuno Santos
Now making name tag for: Luis Fernando Sarmiento
Now on page: 18
Now making name tag for: Bun'ei Sato
Now making name tag for: David Sawyer
Now making name tag for: Joseph Schmitt
Now making name tag for: Christian Schwab
Now making name tag for: Andreas Seifahrt
Now making name tag for: Evan Sinukoff
Now on page: 19
Now making name tag for: David Sliski
Now making name tag for: Scott Smith
Now making name tag for: Alessandro Sozzetti
Now making name tag for: Gudmundur Stefansson
Now making name tag for: Klaus Strassmeier
Now making name tag for: Julian Stuermer
Now on page: 20
Now making name tag for: Andrew Szentgyorgyi
Now making name tag for: Damien Ségransan
Now making name tag for: Angelle Tanner
Now making name tag for: Ryan Terrien
Now making name tag for: René Tronsgaard Rasmussen
Now making name tag for: Stephane Udry
Now on page: 21
Now making name tag for: Jeffrey Valenti
Now making name tag for: Sharon Xuesong Wang
Now making name tag for: Ji Wang
Now making name tag for: Michael Weber
Now making name tag for: Lauren Weiss
Now making name tag for: Robert Wittenmyer
Now on page: 22
Now making name tag for: Jason Wright
Now making name tag for: Mesut YILMAZ
Now making name tag for: Xu Yi
Now making name tag for: Mesut Yilmaz
Now making name tag for: Mathias Zechmeister

In [52]:
finaldf.columns


Out[52]:
Index([u'index', u'FirstName', u'LastName', u'Company', u'Primer', u'PrimerID', u'Monday', u'MonID', u'Tuesday', u'TueID'], dtype='object')

In [54]:
finaldf.FirstName.values


Out[54]:
array([u'Arthur', u'Rachel', u'Guillem', u'Ruth', u'Pamela', u'Mariona',
       u'Roman', u'Fabienne', u'Ozgur', u'Sarbani', u'Florian', u'Jacob',
       u'Thomas', u'Eric', u'Megan', u'Sagi', u'Cullen', u'Andreas',
       u'Adam', u'Francesco', u'Francois', u'Brendan', u'Tabetha', u'John',
       u'Lars A.', u'Jennifer', u'Richard', u'Maria Federica', u'Abhijit',
       u'Jessi', u'William', u'Uriel', u'Matthew', u'Justin', u'Mario',
       u'Allen', u'Rebekah', u'Fabio', u'Rodrigo', u'Scott', u'Courtney',
       u'Xavier', u'Jason', u'Michael', u'Jo\xe3o', u'Tobias', u'Pedro',
       u'Debra', u'Eric', u'Daniel', u'BJ', u'Gabor', u'Peter', u'Bernard',
       u'Matteo', u'Paolo', u'Matt', u'Steve', u'Steve', u'Erica',
       u'Frank', u'Guillaume', u'Sam', u'Artie', u'Raphaelle',
       u'Guillaume', u'Enrique', u'David', u'Joshua', u'Andrew', u'John',
       u'Paul', u'Colby', u'Marco', u'Antonino Francesco', u'David',
       u'Gregory', u'Christophe', u'Zaira', u'Bo', u'Gregory', u'Suvrath',
       u'Luca', u'Rosemary', u'Tyler', u'Nate', u'Michael', u'Ati',
       u'Claire', u'Benjamin', u'Grzegorz', u'Nikhil', u'Hannu',
       u'Francesco', u'Mario', u'David', u'Peter', u'Lisa', u'Sam',
       u'Andreas', u'Jayadev', u'Vinesh', u'Gert', u'Ansgar', u'Paul',
       u'Albert', u'Arpita', u'Nuno', u'Luis Fernando', u"Bun'ei",
       u'David', u'Joseph', u'Christian', u'Andreas', u'Evan', u'David',
       u'Scott', u'Alessandro', u'Gudmundur', u'Klaus', u'Julian',
       u'Andrew', u'Damien', u'Angelle', u'Ryan', u'Ren\xe9', u'Stephane',
       u'Jeffrey', u'Sharon Xuesong', u'Ji', u'Michael', u'Lauren',
       u'Robert', u'Jason', u'Mesut', u'Xu', u'Mesut', u'Mathias'], dtype=object)

In [62]:
finaldf.LastName.values


Out[62]:
array([u'Adams', u'Akeson', u'Anglada-Escude', u'Angus', u'Arriagada',
       u'Badenas', u'Baluev', u'Bastien', u'Basturk', u'Basu', u'Bauer',
       u'Bean', u'Beatty', u'Bechter', u'Bedell', u'Ben-Ami', u'Blake',
       u'Boesch', u'Bolton', u'Borsa', u'Bouchy', u'Bowler', u'Boyajian',
       u'Brewer', u'Buchhave', u'Burt', u'Capps', u'Cersullo',
       u'Chakraborty', u'Cisewski', u'Cochran', u'Conod', u'Cornachione',
       u'Crepp', u'Damasso', u'Davis', u'Dawson', u'Del Sordo', u'Diaz',
       u'Diddams', u'Dressing', u'Dumusque', u'Eastman', u'Endl', u'Faria',
       u'Feger', u'Figueira', u'Fischer', u'Ford', u'Foreman-Mackey',
       u'Fulton', u'Furesz', u'Gao', u'Gaudi', u'Genoni', u'Giacobbe',
       u'Giguere', u'Girvin', u'Girvin', u'Gonzales', u'Grundahl',
       u'HEBRARD', u'Halverson', u'Hatzes', u'Haywood', u'Hebrard',
       u'Herrero', u'Hogg', u'Hopgood', u'Howard', u'Johnson', u'Jorden',
       u'Jurgenson', u'Landoni', u'Lanza', u'Latham', u'Laughlin',
       u'Lovis', u'M. Berdi\xf1as', u'Ma', u'Mace', u'Mahadevan',
       u'Malavolta', u'Mardling', u'McCracken', u'McCrady', u'Mossman',
       u'Motalebi', u'Moutou', u'Nelson', u'Nowak', u'Padmanabhan',
       u'Parviainen', u'Pepe', u'Perez', u'Phillips', u'Plavchan',
       u'Prato', u'Quinn', u'Quirrenbach', u'Rajagopal', u'Rajpaul',
       u'Raskin', u'Reiners', u'Robertson', u'Rosich', u'Roy', u'Santos',
       u'Sarmiento', u'Sato', u'Sawyer', u'Schmitt', u'Schwab',
       u'Seifahrt', u'Sinukoff', u'Sliski', u'Smith', u'Sozzetti',
       u'Stefansson', u'Strassmeier', u'Stuermer', u'Szentgyorgyi',
       u'S\xe9gransan', u'Tanner', u'Terrien', u'Tronsgaard Rasmussen',
       u'Udry', u'Valenti', u'Wang', u'Wang', u'Weber', u'Weiss',
       u'Wittenmyer', u'Wright', u'YILMAZ', u'Yi', u'Yilmaz',
       u'Zechmeister'], dtype=object)

In [59]:
hrz_fdg = 1. / 16./ 8.5
leftarr = np.array([0.0294, 0.5, 0.0294, 0.5, 0.0294, 0.5])

In [60]:
leftarr + hrz_fdg


Out[60]:
array([ 0.03675294,  0.50735294,  0.03675294,  0.50735294,  0.03675294,
        0.50735294])

In [ ]: