-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathAirBnB_data_input.py
46 lines (38 loc) · 1.09 KB
/
AirBnB_data_input.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
AirBnB
Reads data, what's next?
Link to scraped data
* http://insideairbnb.com/new-york-city/
* http://insideairbnb.com/get-the-data.html
Prepared for Data Bootcamp course at NYU
* https://github.com/NYUDataBootcamp/Materials
* https://github.com/NYUDataBootcamp/Lab
Written by Dave Backus, February 2016
Created with Python 3.5
"""
"""
import packages, check versions
"""
import sys
import pandas as pd
#import matplotlib.pyplot as plt
print('\nPython version: ', sys.version)
print('Pandas version: ', pd.__version__, '\n')
#%%
"""
read data
"""
urllst = 'http://data.insideairbnb.com/united-states/'
urllst += 'ny/new-york-city/2016-02-02/data/listings.csv.gz'
urlrev = 'http://data.insideairbnb.com/united-states/'
urlrev += 'ny/new-york-city/2016-02-02/data/reviews.csv.gz'
# listings
airlst = pd.read_csv(urllst, compression='gzip')
print('\nListings data')
print('Dimensions:', airlst.shape)
print('Variables:\n', list(airlst), sep='')
# reviews
airrev = pd.read_csv(urlrev, compression='gzip')
print('\nReviews data')
print('Dimensions:', airrev.shape)
print('Variables:\n', list(airrev), sep='')