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