Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- population_data = csv.reader(open("population.dat","r"))
- population_by_country_code = {}
- for row in population_data:
- country = row[0]
- country_code = row[1]
- population_data = []
- for value in row[5:]:
- if value == "":
- population_data.append(None)
- else:
- population_data.append(float(value))
- country_data = {}
- country_data["country"] = country
- country_data["country_code"] = country_code
- country_data["population_values"] = population_data
- population_by_country_code[country_code] = country_data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement