In [58]:
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
from geopy.geocoders import Nominatim
from geopy.distance import vincenty
from __future__ import division
import pickle
matplotlib.style.use('ggplot')
%matplotlib inline
In [52]:
metro_delays = pd.read_csv("We'll be Moving Momentarily - Incidents.csv")
In [53]:
metro_delays.head()
Out[53]:
In [54]:
long_delays = metro_delays[metro_delays['Delay'] >= 30]
len(long_delays)
Out[54]:
In [55]:
long_delays.iloc[0]["Date"]
Out[55]:
In [56]:
metro_delays['Time'] = metro_delays['Time'].str.replace('.','')
metro_delays['time_stamp'] = metro_delays['Date'] + ' ' + metro_delays['Time']
In [57]:
metro_delays['Time'] = pd.to_datetime(metro_delays['time_stamp'], format='%m/%d/%Y %I:%M %p')
metro_delays.head()
Out[57]:
export dataframe with pickle
In [59]:
pickle.dump( metro_delays, open( "metro_delays.p", "wb" ) )
In [ ]: