Homework 4 -- NYC Property Analysis (Course Project Part 1)
Skills Practiced:
Start of course project.
Introduction
You're working with New York City property data to analyze housing patterns and identify development opportunities across the 5 boroughs. This dataset contains property records with information about location, land use, ownership types, and property characteristics that can help understand urban development patterns.
For this assignment, you'll be working with a CSV file containing NYC housing data. The file housing.csv contains the following columns: *TODO: change this to the static link once done
- borough: The NYC borough (Manhattan, Brooklyn, Queens, Bronx, Staten Island)
- zipcode: ZIP code of the property
- address: Street address of the property
- landuse: Type of land use (residential, commercial, etc.)
- ownertype: Category of property ownership
- lotarea: Total lot area in square feet
- bldgarea: Total building area in square feet
- latitude: Latitude coordinate of the property
- longitude: Longitude coordinate of the property
Problem 1
Load the NYC housing data from the CSV file into a table. Define a table called housing-table
with the appropriate column names and types.
Problem 2
Vacant land represents potential development opportunities. Create a new table called vacant-land-properties
that contains only the properties with land use code "11" (Vacant Land).
Problem 3
NYC has various types of residential properties. Design a function housing-type-category
that takes a row from the housing table and returns a string describing the residential category based on the land use code:
- "single-family": land use code "1" (One & Two Family Buildings)
- "walk-up": land use code "2" (Multi-Family Walk-Up Buildings)
- "high-rise": land use code "3" (Multi-Family Elevator Buildings)
- "mixed-use": land use code "4" (Mixed Residential & Commercial Buildings)
- "non-residential": any other land use code
Then, create a new table called categorized-housing
that adds a "housing-type" column to the original housing-table.
Problem 4
Understanding property ownership patterns is crucial for housing policy. Design a function ownership-category
that takes an owner type code and returns a more descriptive string:
- "C" becomes "City-owned"
- "M" becomes "Mixed ownership"
- "O" becomes "Other public"
- "P" becomes "Private"
- "X" becomes "Tax-exempt"
Then, create a new table called table-with-ownership
that replaces the "ownertype" column in the original housing-table with the descriptive ownership categories.