from io import BytesIO
import requests
import pandas as pd
filename = 'https://docs.google.com/spreadsheet/ccc?key=0Ak1ecr7i0wotdGJmTURJRnZLYlV3M2daNTRubTdwTXc&output=csv'
r = requests.get(filename)
data = r.content
df = pd.read_csv(BytesIO(data), index_col=0,parse_dates=['Quradate'])
|
City |
region |
Res_Comm |
mkt_type |
Quradate |
National_exp |
Alabama_exp |
Sales_exp |
Inventory_exp |
Price_exp |
Credit_exp |
0 |
Dothan |
South_Central-Montgomery-Auburn-Wiregrass-Dothan |
Residential |
Rural |
2010-01-15 |
2 |
2 |
3 |
2 |
3 |
3 |
10 |
Foley |
South_Mobile-Baldwin |
Residential |
Suburban_Urban |
2010-01-15 |
4 |
4 |
4 |
4 |
4 |
3 |
12 |
Birmingham |
North_Central-Birmingham-Tuscaloosa-Anniston |
Commercial |
Suburban_Urban |
2010-01-15 |
2 |
2 |
3 |
2 |
2 |
3 |
38 |
Brent |
North_Central-Birmingham-Tuscaloosa-Anniston |
Residential |
Rural |
2010-01-15 |
3 |
3 |
3 |
3 |
3 |
2 |
44 |
Athens |
North_Huntsville-Decatur-Florence |
Residential |
Suburban_Urban |
2010-01-15 |
4 |
5 |
4 |
4 |
4 |
4 |
# source : https://stackoverflow.com/questions/19611729/getting-google-spreadsheet-csv-into-a-pandas-dataframe