In [17]:
import pandas as pd
import random

In [3]:
excuse = pd.read_csv("data/excuse.csv")

In [8]:
excuse.head(2)


Out[8]:
excuse headline hyperlink
0 the fog was unexpected and did slow us down a bit De Blasio Blames 'Rough Night' and Fog for Mis... http://www.dnainfo.com/new-york/20141112/rocka...
1 we had some meetings at Gracie Mansion De Blasio 30 Minutes Late to Rockaway St. Patr... http://www.dnainfo.com/new-york/20150307/belle...

In [9]:
len(excuse)


Out[9]:
11

In [45]:
def get_excuse(name,location,data):
    i = random.randint(0,(len(excuse)-1))
    print("Sorry", name ,", I'm late to meet you at", location, ",",data['excuse'][i],'.')
    print(data['hyperlink'][i])

In [49]:
get_excuse("Richard","Central park",excuse)


Sorry Richard , I'm late to meet you at Central park , we need a better system .
http://www.nytimes.com/2015/05/06/nyregion/mayor-de-blasio-is-irked-by-a-subway-delay.html?ref=nyregion&_r=0

In [ ]:


In [ ]: