Week 2

Mengyao Li
Data Mining the City
2 min readSep 20, 2017

Session A project ideas:

  1. Airbnb makes neighborhood less safe

As more and more Airbnb apartments appear in the city, more short-term visitors come and go. Do the rising Airbnb apartments increase the crime rate of the neighborhood? I would map the changes of Airbnb quantity and spatial distribution, and match them with NYC neighborhoods. The datasets would be Airbnb dataset and NYC crime rate.

Here is an example of interactive map that showing Airbnb rent price and occupance:

Week 2 tutorial

size(200,200)
#this is the dictionary of face
dict = {‘faceXPosition’:50, ‘faceYPosition’:60,’faceRadius’:100}
rect(dict[‘faceXPosition’], dict[‘faceYPosition’], dict[‘faceRadius’], dict[‘faceRadius’])
#this is the mouth
mouthXPosition = 100
mouthYPosition = 120
mouthWidth = 50
mouthHeight = 50
mouthStart = 0
mouthStop = PI
mouthMode = CHORD
arc(mouthXPosition, mouthYPosition, mouthWidth, mouthHeight, mouthStart, mouthStop, mouthMode)
#this are eyebrows
listEyebrow = [70, 90, 110, 130]
line(listEyebrow [0], listEyebrow [1], listEyebrow [1], listEyebrow [1])
line(listEyebrow [2], listEyebrow [1], listEyebrow [-1], listEyebrow [1])
#this is left eye
leftEyeXPosition = 75
leftEyeYPosition = 95
eyeRadius = 7
fill(0)
stroke(0)
ellipse(leftEyeXPosition, leftEyeYPosition, eyeRadius, eyeRadius)
#this is right eye
rightEyeXPosition = 115
rightEyeYPosition = 95
eyeRadius = 7
fill(0)
stroke(0)
ellipse(rightEyeXPosition, rightEyeYPosition, eyeRadius, eyeRadius)
#this are hairs
line(80, 60, 90, 40)
line(90, 60, 100, 40)
line(100, 60, 110, 40)
line(110, 60, 120, 40)
line(120, 60, 130, 40)
#save as image
saveFrame(“smilingface.png”)size(200,200)
#this is the dictionary of face
dict = {‘faceXPosition’:50, ‘faceYPosition’:60,’faceRadius’:100}
rect(dict[‘faceXPosition’], dict[‘faceYPosition’], dict[‘faceRadius’], dict[‘faceRadius’])
#this is the mouth
mouthXPosition = 100
mouthYPosition = 120
mouthWidth = 50
mouthHeight = 50
mouthStart = 0
mouthStop = PI
mouthMode = CHORD
arc(mouthXPosition, mouthYPosition, mouthWidth, mouthHeight, mouthStart, mouthStop, mouthMode)
#this are eyebrows
listEyebrow = [70, 90, 110, 130]
line(listEyebrow [0], listEyebrow [1], listEyebrow [1], listEyebrow [1])
line(listEyebrow [2], listEyebrow [1], listEyebrow [-1], listEyebrow [1])
#this is left eye
leftEyeXPosition = 75
leftEyeYPosition = 95
eyeRadius = 7
fill(0)
stroke(0)
ellipse(leftEyeXPosition, leftEyeYPosition, eyeRadius, eyeRadius)
#this is right eye
rightEyeXPosition = 115
rightEyeYPosition = 95
eyeRadius = 7
fill(0)
stroke(0)
ellipse(rightEyeXPosition, rightEyeYPosition, eyeRadius, eyeRadius)
#this are hairs
line(80, 60, 90, 40)
line(90, 60, 100, 40)
line(100, 60, 110, 40)
line(110, 60, 120, 40)
line(120, 60, 130, 40)
#save as image
saveFrame(“smilingface.png”)

--

--