I'm doing a university project on some animmal distribution, and I need to create a Choroplet type map of Italy, I tried to find some data about regions and I found this https://github.com/deldersveld/topojson/tree/master/countries/italy, it's exactyl what I need but I don't know how to import and use in python. I downloaded it and use the line pd.read_json(r'Path') but it doesn't work. Can tell me if it's possible using this type of data? Or I should make them by myself? Thanks a lot
1 Answer
It's a json file, so you will load it like this:
import json
with open('/path/to/your/italy-provinces.json') as f:
data = json.load(f)
print(data)
data is now a dictionary, you can access its values like this:
print(data.keys())
#dict_keys(['type', 'arcs', 'transform', 'objects'])
print(data['objects'])
The objects contains information about cities like name, arcs, etc. And the arcs contains coordinates of cities
