How expensive are the real estate properties in NYC?

Miaozhi Yu
Posted on Aug 8, 2016



Every year people come to New York City from all over the world to pursue careers, chase dreams, and seek success. They might even want to buy a home. In that case, these questions may come to mind: What are the prices of the properties in NYC? What kind of property will I be able to buy? What is the average price in my neighborhood?  This shiny project seeks to provide answers to these questions.


Source of Data:


The data comes from a real estate company website, City Realty and covers sales history from 2003 onward. The shiny app focuses solely on the year 2016.  The original data contains the following variables:


  1. Address, type string, gives the address of each sale
  2. Neighborhood, type string, gives the neighborhood of each sale
  3. Beds, type string, gives the number of bedrooms in each sale
  4. Bath, type string, gives the number of bathrooms in each sale
  5. Size, type string, gives the size of each sale
  6. Price.FT2, type string, gives the price per square feet of each sale
  7. Price, type string(with dollar sign), gives the total price of each sale
  8. Sale.Date, type string, gives the sale date




For preprocessing the geocode() function turned addresses into coordinates to facilitate plotting on a map. Sometimes this process produced errors such as putting a NYC property in Australia.  To solve this the area of note was restricted to NYC. The addition of a variable called Area was created which assigns boroughs to each property.  Finally, the Price.FT2 and Price variables were transformed from strings to numbers, and renamed  Cost.FT2, and Cost.   

The default map where all the sales are plotted appears first in the Interactive Map panel.

On the side bar, you can choose which neighborhood you want to have a look at, the price range and the property type(2b2b eg.). Let's say you chose Brooklyn, the map will give all the location of the sales and number of sales in each area.


If you are particularly interested in one of the properties, you can simply zoom in and click on that property. A popup will appear and show you the address and a website link to this property.



In the Explore data session, I calculated the average price per square feet for each Area so that you can see the price trend over time.


Of course, you can compare prices in multiple Areas as well.


In the Reference panel, you can explore the original data and do some search also.


For example, you might want to know the most expensive property listed in this shiny app. By looking at the slider in the interactive map, we know that the maximum is about 59M. Thus, we simply type in 59 and the result will come out.



Next Steps:

  1. Improve the shiny app in both algorithm and in UI perspective.
  2. Webscrape URL of the profile of each sale and link them to each sale in the popup.

Thank you for reading this blog post. Please feel free to give any comments!


About Author

Miaozhi Yu

Miaozhi Yu

Miaozhi recently received her Master’s degree in Mathematics from New York University. Before that she received a Bachelor’s Degree in both Mathematics and Statistics with a minor in Physics from UIUC. Her research interests lie in random graphs...
View all posts by Miaozhi Yu >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp