In [141]:
import pandas as pd
import os

In [142]:
permitFile = '../raw_data/Hack4Cause_Housing_BP_Issued_Phased_and_NonPhased_1.1.015_12.31.15(FINAL).xlsx'
data = pd.read_excel(permitFile, 'BP_Issued_NonPh_clean')

In [149]:
data.set_index('issued_date')
data[['neighborhood','issued_date']].set_index('issued_date').groupby(by='neighborhood').resample("Q").count()


Out[149]:
neighborhood
neighborhood issued_date
Active Bethel Citizens 2015-03-31 8
2015-06-30 2
2015-09-30 2
Amazon Neighbors Association 2015-06-30 1
Cal Young Neighborhood Association 2015-03-31 6
2015-06-30 11
2015-09-30 3
2015-12-31 13
Churchill Area Neighbors 2015-03-31 16
2015-06-30 11
2015-09-30 0
2015-12-31 1
Downtown Neighborhood Association 2015-03-31 1
Fairmount Neighbors 2015-09-30 1
Far West Neighborhood Association 2015-12-31 1
Friendly Area Neighbors 2015-03-31 5
2015-06-30 0
2015-09-30 2
2015-12-31 1
Harlow Neighbors 2015-03-31 4
2015-06-30 1
2015-09-30 2
Jefferson Westside Neighbors 2015-03-31 1
2015-06-30 1
Laurel Hill Valley Citizens 2015-03-31 2
2015-06-30 1
2015-09-30 1
2015-12-31 5
Northeast Neighbors 2015-03-31 6
2015-06-30 54
2015-09-30 15
2015-12-31 13
River Road Community Organization 2015-03-31 14
2015-06-30 8
2015-09-30 1
2015-12-31 10
Santa Clara Community Organization 2015-03-31 5
2015-06-30 11
2015-09-30 8
2015-12-31 13
South University Neighborhood Association 2015-09-30 1
Southeast Neighbors 2015-03-31 3
2015-06-30 4
2015-09-30 1
2015-12-31 2
Southwest Hills Neighborhood Association 2015-03-31 1
2015-06-30 1
2015-09-30 3
Unknown 2015-06-30 3
2015-09-30 2
2015-12-31 3
West Eugene Community Organization 2015-12-31 1
West University Neighbors 2015-12-31 1

In [151]:
fh = open('C:/Users/Heron/Documents/python/c-dash/cityview/web/html/data/permits.json', 'w')
fh.write(data.to_json())
fh.close()