Assignment 2: Mayoral Excuses


In [1]:
import pandas as pd
from numpy import random as rd
df = pd.read_csv('data/excuse.csv')

In [2]:
phrase = "\nSorry, {}, I was late to {} to meet you, {}. \nRead the story: {}"

name = input("What's your name? ")
location = input("Where were you supposed to go? ")
rand_index = rd.randint(0, len(df)-1)

print(phrase.format(name, location, df['excuse'].iloc[rand_index], df['hyperlink'].iloc[rand_index]))


What's your name? Aldo
Where were you supposed to go? Downtown

Sorry, Aldo, I was late to Downtown to meet you, we waited 20 mins for an express only to hear there were major delays. 
Read the story: http://www.nytimes.com/2015/05/06/nyregion/mayor-de-blasio-is-irked-by-a-subway-delay.html?ref=nyregion&_r=0

In [ ]: