Toolkit 0 & 1 - #1
Conversation
Toolkit 0&1
|
import folium m = folium.Map(location=[block_groups["lat"].mean(), block_groups["lon"].mean()], zoom_start=8) for _, row in block_groups.iterrows(): for _, row in block_groups.iterrows(): for _, row in block_groups.iterrows(): m.save("block_groups_centroids_map.html") |
|
Run the code above to see a visualization of the issue with hard-coding the radius to 1000 meters from each centroid for each block group. |
tylerharter
left a comment
There was a problem hiding this comment.
Good start!
Let's also have a README describing what the tools are and how to use them.
There was a problem hiding this comment.
Let's not put actual data in this repo. Just the tools.
| @@ -0,0 +1,83 @@ | |||
| import geopandas as gpd | |||
There was a problem hiding this comment.
Let's have a different file for each program. Let's use short, descriptive names for the programs, without special characters.
| import time | ||
| import os | ||
|
|
||
| # Load shapefile |
There was a problem hiding this comment.
Let's have a main() function for this.
| import os | ||
|
|
||
| # Load shapefile | ||
| block_groups = gpd.read_file("tl_2024_55_bg/tl_2024_55_bg.shp").to_crs(epsg=4326) |
|
|
||
| N = 50 # Number of block groups sampled | ||
|
|
||
| for idx, row in block_groups.iterrows(): |
There was a problem hiding this comment.
itertuples is much faster that iterrows.
Tool 0:
input: some way to define an are of interest
GTFS file OR
feed in shapefile OR
GeoJSON OR
other…
output:
geographic areas
centroids of census tracts? block groups? blocks?
stats for the geographic areas
like population, cars per capita, race, income, …
https://www.census.gov/data/developers/guidance/api-user-guide.html?
Tool 1:
input: the geographic regions
Output:
services of interest (e.g., pulled from Yelp)