-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAggregateData.py
More file actions
33 lines (24 loc) · 979 Bytes
/
Copy pathAggregateData.py
File metadata and controls
33 lines (24 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
##import each .py file
import pandas as pd
import YelpDataAPI as yd
import CraigslistCode as craig
import ZillowHousingDataByZip as zillow
import ArrestData as arrests
def getData():
#Call functions from each .py file to get data
#DataFrames to use for aggregation
df_craigslistSummary = craig.getData()
df_zillowSummary = zillow.zillowData()
df_arrests = arrests.arrestData()
df_yelpSummaryTop = yd.getData()
# checking size of dataFRames to be combined
print("zillow df size: ", df_zillowSummary.shape, "\n")
print("craigslist df size: ", df_craigslistSummary.shape, "\n")
print("Yelp df size: ", df_yelpSummaryTop.shape, "\n")
print("Arrests df size: ", df_arrests.shape, "\n")
result = pd.concat([df_zillowSummary, df_craigslistSummary, df_yelpSummaryTop, df_arrests], axis=1, join='outer')
result.to_excel('Result.xlsx')
def main():
getData()
if __name__ == '__main__':
main()