Skip to content

Scraper for New York City Board of Elections (unofficial) election night results

License

Notifications You must be signed in to change notification settings

cmgsalazar/us-elex-2024-bx

Repository files navigation

U.S. Elections 2024

This repository contains data scraped from the New York City Board of Elections website.

Resulting analysis will be used for a reporting assignment that looks into voting results in the Bronx, for the Mott Haven Herald and Hunts Point Express.

image

Data sources

Content and process

notebooks

  • scraper.ipynb used BeautifulSoup to scrape vote results per election district in the Bronx
  • clean-up.ipnyb prepared and sanitized dataset for visualization

I created a new column that merges the assembly district and election district numbers, so we have a code consistent with geocode IDs.

In an earlier version, I added all Trump votes and Harris votes, then calculated the differential vote counts for choropleth mapping. In this version, I also calculated for the percentages of Trump and Harris votes, so we can use a fixed barometer (percentage points) to compare with other election years.

I use vote differential to visualize the data — instead of simply counting the number of votes — because lands don't vote; people do.

csv files

  • bx-assembly_districs.csv holds all links of Bronx assembly district votes breakdown
  • electoral_district_votes.csv holds scraped unofficial election night results in each of the electoral districts in Bronx assembly districts
  • 2020_votes_full holds our main dataset, which includes vote counts and percentage of votes (both per candidate and totals)

viz

This folder holds our Illustrator and exported PNG file. The version of visualization embedded here shows value counts of vote differential.

About

Scraper for New York City Board of Elections (unofficial) election night results

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published