Created
December 10, 2019 21:01
-
-
Save aialenti/e35acb16cb35ad1050642812e8b5dc8e to your computer and use it in GitHub Desktop.
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
class TSP(): | |
cities = None | |
santa = None | |
variables_dict = None | |
x = None | |
path = None | |
def __init__(self, population_lower_bound=10e5 * 3): | |
cities = pd.read_csv("worldcities.csv") | |
self.cities = cities.loc[cities["population"] >= population_lower_bound][["city","lat","lng","population"]].reset_index() | |
# Add Santa's house | |
santa_df = pd.DataFrame([["Santa's House",66.550331132,25.886996452,10000]], columns=["city","lat","lng","population"]) | |
self.cities = pd.concat([self.cities, santa_df]).reset_index() | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment