1

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

1 Answer 1

1

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'])

enter image description here

The objects contains information about cities like name, arcs, etc. And the arcs contains coordinates of cities

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.