Created
August 20, 2024 14:58
-
-
Save jtrive84/ea09f1ebb35253e331bf059ab355b548 to your computer and use it in GitHub Desktop.
Groupy into list in Pandas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a DataFrame that takes a dataset of 50k State - County - ZIp combinations | |
# to a table of ~3k reocrds keyed by County, with a list column of zipcodes. | |
ggck = dfz2c.groupby(["STATE", "FIPS", "County"], as_index=False)["ZIP"].apply(list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment