image
imagewidth (px) 590
906
|
|---|
NYC Property Sales – Exploratory Data Analysis
Author: TODO
Notebook: TODO – link to your Colab / .ipynb on this dataset
Dataset source: NYC Property Sales (originally from Kaggle, re-hosted on this Hugging Face dataset)
Video walkthrough: TODO – Loom / Zoom / YouTube link once recorded
Overview
This project performs an Exploratory Data Analysis (EDA) on tens of thousands of New York City property sales.
The goal is to understand which property characteristics are most associated with higher sale prices across the five boroughs.
The dataset includes one row per recorded sale, with information such as:
BOROUGH– numeric code for borough- 1 = Manhattan, 2 = Bronx, 3 = Brooklyn, 4 = Queens, 5 = Staten Island
NEIGHBORHOOD– neighborhood nameBUILDING CLASS CATEGORY– coarse property type (e.g., one-family home, condo, co-op, walk-up rentals)RESIDENTIAL UNITS,COMMERCIAL UNITS,TOTAL UNITSLAND SQUARE FEET,GROSS SQUARE FEETYEAR BUILTSALE PRICE– our target variable
We focus on how location, building type, size, and age relate to sale price.
Main Research Question
Which factors (borough, building type, size, number of units, building age) are most associated with higher property sale prices in NYC?
All analysis is done on a cleaned version of the data (eda_clean in the notebook), where sale prices are numeric and obvious invalid values have been removed.
Data Cleaning
Key cleaning steps performed in the notebook:
Column selection
We keep only the columns relevant to sale price and our research questions:
BOROUGH,NEIGHBORHOOD,BUILDING CLASS CATEGORYRESIDENTIAL UNITS,COMMERCIAL UNITS,TOTAL UNITSLAND SQUARE FEET,GROSS SQUARE FEETYEAR BUILTSALE PRICE
Convert
SALE PRICEto numericThe original
SALE PRICEcolumn is text with commas and blank entries.
We:- Strip commas and whitespace.
- Convert to numeric with
pd.to_numeric(..., errors="coerce").
Remove missing and zero sale prices
- Rows where
SALE PRICEis missing (NaN) are dropped. - Rows with
SALE PRICE == 0are removed, as these almost certainly represent non-arm’s-length transactions or bad data.
- Rows where
Keep all other values, then explore outliers
We do not hard-delete very high sale prices from the working dataset, but we:
- Compare distributions before/after zero removal.
- Inspect the tail of the distribution.
- For one diagnostic plot, cap prices at the 99th percentile to visualize the bulk more clearly.
This leaves a large, realistic dataset of NYC property sales with a fully numeric SALE PRICE.
Sale Price Distribution & Outliers
1. Raw distribution (with zeros & outliers)
- Extremely right-skewed.
- Large spike at zero, confirming that many “sales” are recorded with a price of 0.
2. After removing zero sale prices
- The spike at zero disappears.
- Distribution is still heavy-tailed: a small number of very expensive properties dominate the upper end.
3. Distribution of the cleaned data
All subsequent analyses use this cleaned dataset (no missing prices, no zeros).
- Still highly skewed, with a long tail of multi-million-dollar sales.
4. Log-scale view of sale prices
- Applying
log10(SALE PRICE)makes the distribution much more symmetric. - Most sales cluster within a fairly narrow log-range, with only a small number of extreme luxury transactions.
5. Distribution capped at the 99th percentile
- Capping the histogram at the 99th percentile highlights the bulk of “typical” NYC sales.
- Useful for understanding “normal” property prices without being dominated by the very highest outliers.
Research Questions & Key Insights
RQ1 – How does sale price vary by borough?
We compute both mean and median sale prices by borough.
Mean sale price by borough
Median sale price by borough
Insights
- Manhattan (1) clearly has the highest mean and median sale prices.
- Brooklyn (3) is the next most expensive on average.
- Queens (4), Bronx (2) and Staten Island (5) are cheaper, with Staten Island and the Bronx generally at the bottom.
- The gap between mean and median in each borough reflects the influence of a small number of very high-end sales (especially in Manhattan).
RQ2 – Which building class categories have the highest sale prices?
We group by BUILDING CLASS CATEGORY and look at the median sale price, focusing on the top 10 categories with enough observations.
Insights
- High-end apartments dominate the top of the list:
- Walk-up rental buildings (
07 RENTALS - WALKUP APARTMENTS) - Elevator condos, small-unit residential condos, and co-ops
- Walk-up rental buildings (
- Standard one-family and two-family homes appear lower in the ranking.
- This suggests that multi-unit condos/co-ops and prime rental buildings capture the highest transaction prices in the dataset.
RQ3 – How does size (square footage) relate to sale price?
We examine the relationship between gross square feet and sale price using a random sample (to avoid overplotting).
Insights
- There is a general upward trend: larger properties tend to sell for more.
- The relationship is very noisy:
- Many small apartments command high prices in central locations.
- Some large buildings sell for comparatively modest amounts (often in outer boroughs or lower-value neighborhoods).
- Location and building type clearly matter as much as size, if not more.
RQ4 – Do buildings with more units sell for more?
We bin TOTAL UNITS into:
1,2–5,6–10,11–50,51–200,200+
and compute median and mean sale prices by bin.
Median sale price by total units
Mean sale price by total units
Insights
- Properties with 11–50 units have the highest median and mean sale prices.
- Very small buildings (1–5 units) are cheaper overall.
- Very large buildings (
200+units) have lower prices than the 11–50 and 51–200 bins, likely because:- They may be located in less central areas.
- They may be sold at lower price per unit as large rental complexes.
- This suggests a “sweet spot” around mid-sized multi-unit buildings, which often correspond to desirable condo or rental properties.
RQ5 – How does building age (decade built) relate to sale price?
We derive a DECADE_BUILT column from YEAR BUILT, and for this question we exclude obvious errors (year 0 or clearly impossible values like 1110).
Then we compute the median sale price per decade.
Insights
- Some very old decades (e.g., 1830s–1880s) show high median prices, likely reflecting historic brownstones and landmark buildings in prime neighborhoods.
- Mid-20th century buildings often have lower median sale prices, possibly due to more modest construction or less central locations.
- Newer construction (recent decades) shows a modest uptick, reflecting modern condos and redevelopments, but not always reaching the premium of the most historic stock.
- Overall, age interacts with location and building type – old does not automatically mean cheap or expensive.
Summary of Findings
- Location matters a lot: Manhattan is consistently the most expensive borough; Brooklyn is second, while the Bronx and Staten Island are much cheaper.
- Building type is crucial: High-end condos, co-ops, and rental apartment buildings dominate the top of the price distribution.
- Size matters, but with huge variation: Larger square footage generally implies higher prices, but there are many small but very expensive units in prime areas.
- Mid-sized multi-unit buildings (11–50 units) tend to command the highest total sale prices, with very small and very large buildings selling for less in total.
- Building age shows a nuanced pattern: Historic 19th-century properties and some newer developments can both be expensive; mid-century stock tends to be cheaper.
These findings all support the main conclusion that NYC property prices are driven by a combination of borough, building class, size, and age, with strong interactions between them.
Visualizations (Quick Index)
- Sale price distributions:
- Raw vs after removing zeros
Plot - Sale Price Distribution.pngPlot - Sale Price Distribution (no zero's).png
- Cleaned data, log-scale, and 99th-percentile cap
Plot - Sale Price Distribution Clean Data.pngPlot - Sale Price Distribution on Log10 Scale.pngPlot - Sale Price Distribution (capped at 99th percentile).png
- Raw vs after removing zeros
- Location:
Plot - Mean Sale Price by Borough.pngPlot - Median Sale Price By Borough.png
- Building type:
Plot - Median Sale Price By Building Class Category (top 10).png
- Size & intensity:
Plot - Sale Price vs Square Feet.pngPlot - Median Sale Price By Total Units.pngPlot - Mean Sale Price By Total Units.png
- Age:
Plot - Median Sale Price By Decade Built.png
Files Included
nyc_rolling_sales.csv– original NYC property sales dataset (cleaned subset used in this project).nyc_property_sales_eda.ipynb– full Python + pandas EDA notebook.README.md– project summary, research questions, and plots.- Video walkthrough (Loom / YouTube): [link to be added here].
- Interactive Colab notebook:
Open in Google Colab
How to Reproduce
- Open the notebook: TODO – link to your
.ipynbhere - Install dependencies (mainly
pandas,numpy,matplotlib). - Load the dataset from this Hugging Face repo.
- Run the notebook cells top-to-bottom:
- Data loading & cleaning
- EDA & descriptive statistics
- Visualizations for RQ1–RQ5
Video Walkthrough
Once recorded, place your video link here, for example:
▶️ Video walkthrough: TODO – Loom / Zoom / YouTube link
The video should briefly introduce the dataset and then walk through:
- Cleaning steps
- Main plots
- Answers to the research questions
- Any limitations and ideas for future work
- Downloads last month
- 54

.png)


.png)


.png)



