100 Airbnb in New York

Jujie Xu
Data Mining the City
1 min readOct 31, 2017

Where could you choose to stay for a night when you have 100 dollars in pocket and prefer 100/100 quality service in New York City?

This map gives you wide choices, all you need to do is to press your mouse! The brief introduction would also appear.

data resource: http://insideairbnb.com/get-the-data.html (New York City, 2017-10–2)

airbnb 100 map-week 5
import spatialpixel.mapping.slippymapper as slippymapper
import csv
import random

def setup():
size(1000, 800, P2D)
global nyc
nyc = slippymapper.SlippyMapper(40.715, -73.899, 11, 'carto-dark', width, height)
with open('airbnb100.csv') as f:
reader = csv.reader(f)
header = reader.next()
global latitude
latitude = []
global longitude
longitude = []
global name
name = []
for row in reader:
latitude.append(float(row[0]))
longitude.append(float(row[1]))
name.append(str(row[2]))
nyc.render()
def draw():
background(255)
nyc.draw()
noStroke
fill(0)
rect(600,700,375,20)
if mousePressed:
i=random.randint(0,415)
nyc.addMarker(latitude[i], longitude[i])
fill(0, 102, 153)
text(name[i],605,710)
i += 1

--

--