Created
August 8, 2020 19:20
-
-
Save AnnikaNoren/cc724a377c400b4cd874d1137db6f26d to your computer and use it in GitHub Desktop.
zipcode_lat_dict.py
This file contains 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 df with zip code as index and mean latitude value for each zip code | |
no_index_zip_lat = df.groupby('zipcode', as_index=True)['lat'].mean() | |
# Convert the data frame to a dict, the zip is the key and mean latitude is the value | |
zip_lat_dict = no_index_zip_lat.to_dict() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment