Created
April 28, 2021 15:23
-
-
Save jiobu1/8c630242ea467b2d42caf917a12cf841 to your computer and use it in GitHub Desktop.
create dictionary of cities
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 list of cities | |
cities_list = list(population['City,State']) | |
# group cities from the population_melt.csv | |
def rnd_series(city): | |
subset = population_melt[population_melt['City,State']== city] | |
dates = (pd.DataFrame({'ds': pd.to_datetime(population_melt['ds'])})) | |
return subset | |
# create dictionary of city name and grouped population_melt.csv | |
series = [rnd_series(city) for city in cities_list] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment