This file contains hidden or 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
# Create heatmap | |
sns.heatmap(minutes_df.groupby([minutes_df['Business Date'].dt.date, minutes_df['Business Date'].dt.strftime('%H:00')]) | |
['Orders'].mean() | |
.rename_axis(index=['Date','Hour']) | |
.unstack(level=0), | |
cmap='coolwarm' | |
) | |
# Add title | |
plt.title('Customers in Queue Over Time') |
This file contains hidden or 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
# Initialize date ranges list | |
date_ranges_list = [] | |
# Loop through all the orders placed on the source file | |
for i, row in df.iterrows(): | |
# Get Start/End Time | |
enter_t = row["OrderCreatedLocalDateTime"].replace(second=0, microsecond=0) | |
exit_t = row["TimeOutOfQueue"].replace(second=0, microsecond=0) |
This file contains hidden or 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
# Calculate timeframe from input file on a minute basis | |
# If the timespan from the source file is less than a day | |
if (pd.to_datetime(df.iloc[-1,0]) - pd.to_datetime(df.iloc[0,0])).days == 0: | |
timeframe = pd.date_range( | |
df.iloc[0,0], | |
periods=60*24, | |
freq='1min' | |
) | |
# If the timespan from the source file is more than a day | |
else: |
This file contains hidden or 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 datetime | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
# Read csv file | |
df = pd.read_csv('orders.csv') | |
# Convert OrderCreatedLocalDateTime column to datetime type |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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() |
NewerOlder