Anurag Gupta

199 points
User profile image.
India

Anurag Gupta is an Engineer by education but a police officer by profession. He is a Python enthusiast who has recently co-authored a book on Python named Python Programming: Problem Solving, Packages and Libraries published by McGraw Hill. He is available at 999.anuraggupta at Gmail and loves to hear from readers on Python related subjects.

Authored Content

Authored Comments

Hi
I wrote this article.
Plotly has an "inbuilt geometry" for countries of the world. If you want to plot for a different geometry the you need to provide it to the attribute geojson of the function.
You can download country data from:- https://gadm.org/download_country_v3.html as shape files and then converted to GeoJSON using the Python library Geopandas.
A small script (written by me) to convert data from shape files to geojson is available at:- https://github.com/ag999git/data/blob/master/shape2geojson.py

I have downloaded the geometry for Indian states and then "converted" it into geojson. It is available here:- https://github.com/ag999git/data/blob/master/gadm36_IND_1.json