In [2]:
import pandas as pd
excuses_df= pd.read_csv("data/excuse.csv")


/Users/Monica/.virtualenvs/dataanalysis/lib/python3.5/site-packages/matplotlib/__init__.py:1035: UserWarning: Duplicate key in file "/Users/Monica/.matplotlib/matplotlibrc", line #2
  (fname, cnt))

In [3]:
excuses_df.head()


Out[3]:
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...
2 I had a very rough night and woke up sluggish De Blasio Blames 'Rough Night' and Fog for Mis... http://www.dnainfo.com/new-york/20141112/rocka...
3 I just woke up in the middle of the night and ... De Blasio Blames 'Rough Night' and Fog for Mis... http://www.dnainfo.com/new-york/20141112/rocka...
4 we had some stuff we had to do De Blasio 30 Minutes Late to Rockaway St. Patr... http://www.dnainfo.com/new-york/20150307/belle...

In [4]:
excuse = ""

In [5]:
person = input('Enter your name: ')


Enter your name: Monica

In [6]:
location = input('Where was the mayor supposed to meet you? ')


Where was the mayor supposed to meet you?Baltimore

In [38]:
import random
#stop = len(excuses_df)

In [48]:
#random_excuse = excuses_df['excuse'][random.randrange(stop)]
#print(type(random_excuse))

In [49]:
# print("Sorry,", person, "I was late to", location, 'to meet you,', random_excuse)

In [50]:
stop = len(excuses_df)
random_index = random.randrange(stop)
link = excuses_df['hyperlink'][random_index]
random_excuse = excuses_df['excuse'][random_index]




print("Sorry,", person, "I was late to", location, 'to meet you,', random_excuse, "url: " , link)


Sorry, Monica I was late to Baltimore to meet you, we need a better system url:  http://www.nytimes.com/2015/05/06/nyregion/mayor-de-blasio-is-irked-by-a-subway-delay.html?ref=nyregion&_r=0

In [ ]:


In [ ]: