More geopandas thoughts

One of the reasons I got interested in PANDAS was not data wrangling but quick and simple geodata manipulation. That said, PANDAS is an amazing tool for wrangling.

The first question I had – how to place addresses into districts – geocode was pretty easy to do with Geopandas. Like most of PANDAS. I posted the answer to that a few weeks back.

But the next question in my mind is figuring out two additional problems:

1) Calculate the percentage of old districts in new districts

Basically, this would involve a join and some kind of math to calculate percentage of area. I’ve done something similar in QGIS in the past but I want to do this programmatically and as fast and simply as possible.

For example, how much of the various 2012 Senate Districts are in the 2022 Senate districts?

2) Take block or block group data and aggregate or average it together to calculate the amount an overlaid district contains

I think I’ve done something similar in QGIS but figuring out the specifics of the join and dissolve is what I need to figure out. Again, probably not a difficult problem especially in PANDAS.

For example, what is the Median Household income of an Election District?

Leave a Reply

Your email address will not be published. Required fields are marked *