This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build seaborn replot | |
g = sns.relplot( | |
data=data, | |
x="Replicate", | |
y="Value", | |
hue="Operator", | |
style="Operator", | |
col="Part", | |
col_wrap=5, | |
aspect=0.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add Replicate column | |
data["Replicate"] = list(np.arange(1, data["Part"].value_counts()[1]+1))*(int(len(data["Part"])/data["Part"].value_counts()[1])) | |
# Display top rows | |
data.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import libraries and dependencies | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
# Open Excel file | |
data = pd.read_excel("msa_2_crossed.xlsx") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First name: Roberto | |
Last name: Salazar | |
Email address: [email protected] | |
Universities: ['Northwestern University', 'State University of New York at Binghamton'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Print results | |
print(f"First name: {myResume.firstName}") | |
print(f"Last name: {myResume.lastName}") | |
print(f"Email address: {myResume.emailAddress}") | |
print(f"Universities: {myResume.universities}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Instantiate myResume variable | |
myResume = Resume(text) | |
# Obtain resume information | |
myResume.get_first_name() | |
myResume.get_last_name() | |
myResume.get_email() | |
myResume.get_univerisities() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Resume: | |
def __init__(self, text): | |
self.text = text | |
self.firstName = "" | |
self.lastName = "" | |
self.emailAddress = "" | |
self.universities = [] | |
def get_first_name(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define multiple universities names patterns | |
sub_patterns = [ | |
'[A-Z][a-z]* [A-Z][a-z]* [A-Z][a-z]* University of [A-Z][a-z]* [A-Z][a-z]* at [A-Z][a-z]* [A-Z][a-z]*', | |
'[A-Z][a-z]* [A-Z][a-z]* [A-Z][a-z]* University of [A-Z][a-z]* [A-Z][a-z]* at [A-Z][a-z]*', | |
'[A-Z][a-z]* [A-Z][a-z]* [A-Z][a-z]* University of [A-Z][a-z]* at [A-Z][a-z]* [A-Z][a-z]*', | |
'[A-Z][a-z]* [A-Z][a-z]* [A-Z][a-z]* University of [A-Z][a-z]* at [A-Z][a-z]*', | |
'[A-Z][a-z]* [A-Z][a-z]* [A-Z][a-z]* University of [A-Z][a-z]* [A-Z][a-z]*', | |
'[A-Z][a-z]* [A-Z][a-z]* [A-Z][a-z]* University of [A-Z][a-z]*', | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_email(self): | |
# Find all strings that follow emails conventions | |
match = re.search(r'[\w.+-]+@[\w-]+\.[\w.-]+', self.text) | |
# Assign word to email address | |
self.emailAddress = match.group(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_last_name(self): | |
# Split resume text and store up to the first 10 words one position after the index of the string where the first name was found | |
firstWords = self.text.split()[self.text.split().index(self.firstName)+1:10] | |
# Loop through the first 10 words | |
for word in firstWords: | |
# Validate that the word is not a digit and | |
# Validate that the character is an uppercase letter and |
NewerOlder