Plotting Choropleth Maps using Python (Plotly)

Поділитися
Вставка
  • Опубліковано 22 гру 2024

КОМЕНТАРІ • 104

  • @IndianPythonista
    @IndianPythonista  4 роки тому +6

    Code: github.com/nikhilkumarsingh/choropleth-python-tutorial
    Reading Wikipedia Tables using Python: ua-cam.com/video/7NmBCUOIYPk/v-deo.html
    Introduction to Pandas : tinyurl.com/ycr4qytt

    • @naoremanand
      @naoremanand 4 роки тому

      Thank you so much for this wonderful video. How i can get geojsn file for a specific area in a district?

  • @ridamahmood3342
    @ridamahmood3342 2 роки тому +12

    Mann! you are such a lifesaver. I have been stuck in choropleth for hours. Thank you for this video and keeping uploading content like this.

  • @kunalbhadra3227
    @kunalbhadra3227 3 роки тому +3

    I don't normally comment on videos but this was no less than a lifesaver, thank you so much for this tutorial!!

  • @davidcardonamontoya4355
    @davidcardonamontoya4355 3 роки тому +1

    "goes" magically became "geos".
    Excellent video!

  • @emmanuelonah4596
    @emmanuelonah4596 2 роки тому +3

    This is beautiful. Thank you for this awesome knowledge you gave for for free

  • @leonardomolina8958
    @leonardomolina8958 4 роки тому +3

    Great! Thanks for the tutorial. I am currently working with Plotly and Dash, tools with a lot of potential.

  • @sreeramraj4791
    @sreeramraj4791 Рік тому

    Excellent Video.. keep up the good work bro!

  • @faroozrimaaz7092
    @faroozrimaaz7092 Рік тому

    Thank you..I was stuck with my project...you saved me

  • @oluwaseunodibo1395
    @oluwaseunodibo1395 3 роки тому

    Very well explained. I'll be referring to this video quite often

  • @pinakipb2
    @pinakipb2 4 роки тому +2

    Nice video Bro. Really appreciate the hard work. Thanks for the awesome content on Python.

  • @sameerkumarsarmaannadanam3352
    @sameerkumarsarmaannadanam3352 4 роки тому

    Nice demonstration of px mapping capabilities. Thanks!

  • @JiahuiChen-p1c
    @JiahuiChen-p1c Рік тому

    Great video, thanks for making it!

  • @felipeveiga2014
    @felipeveiga2014 3 роки тому +4

    Hello,
    Thank you for the content! I just want to point out that I've found your code in the 11:20 a little bit confusing, I suggest you to write as the following:
    states_id = {}
    for feature in india_states['features']:
    properties = feature['properties']
    states_id[properties['st_nm']] = properties['state_code']
    I think it would become better organized.

  • @gambu4810
    @gambu4810 3 роки тому

    You are simply brrrrrrrrriliant!
    I just subscribed. Your explanations are detailed ❤️

  • @rohandevaki4349
    @rohandevaki4349 Рік тому +1

    if we want to change the output of fig.show from browser to jupyter notebook, what are the commands?
    I tried mentioning chrome for pio.renderers='chrome' ,it is saying `Can't locate a browser with key in ('chrome', 'google-chrome')`

    • @geethavanis6363
      @geethavanis6363 Рік тому +1

      Put 'browser', instead of chrome and make sure the browser u run commands is default.
      Save the plot in variable and type variable name then run, so that the map will be displayed on Jupyter
      Eg:
      x = plot....etc
      x #var will be displayed

  • @FRUXT
    @FRUXT 2 роки тому

    Thank you so much ! ( from France ^^)

  • @eshakashyap3146
    @eshakashyap3146 Рік тому

    I have the shape file where data is in the form of polygon and multipolygon. How to use such data? It is.shp format.

  • @PaulaArias-he4ug
    @PaulaArias-he4ug 8 місяців тому

    Thank you very much for the video! It's been really useful. But I have one question yet. Is it possible to integrate and show this maps on a tkinter frame, or in any other GUI library?

  • @puspendurana7501
    @puspendurana7501 9 місяців тому

    What if I want to display the population density over each state instead of passing it into the Hover Data, how to do that?

  • @dizumadhukalya7750
    @dizumadhukalya7750 3 місяці тому

    Python beginner - I want to plot Literacy rates of Indian states as a choropleth map of India. I have the data in a .csv file as I could not find a geojson file. But I am unable to understand how to map it. My assignment is due tomorrow and I have been stuck in this since yesterday. Any help would be appreciated.

  • @suvarnap9354
    @suvarnap9354 4 роки тому +2

    Very Informative. Thanks a lot.
    Do you have any idea on how to get the name of states look fixed on the map rather than having to hover?

  • @kanupriyaarora7501
    @kanupriyaarora7501 3 роки тому +1

    I am getting a broken pipe error in my code. Can someone please tell me how to fix this?

  • @prinithjeffrey2004
    @prinithjeffrey2004 Рік тому

    how to install the geojson file? i doesn't download after i pressed download

  • @SruthiSrinivas-b9o
    @SruthiSrinivas-b9o Рік тому

    hey it is giving error
    Error: could not locate runnable browser
    can you please help me with this

  • @TarunSharma-jb4dh
    @TarunSharma-jb4dh 2 роки тому

    bro im trying to learn python through projects im unable to load the geojson file if you can help

  • @businessrunner3037
    @businessrunner3037 4 роки тому +1

    Sir regarding geojson file I want to create GOA STATE GEOJSON FILE. HOW TO PROCEED WITH IT?

  • @karankumarify
    @karankumarify 3 роки тому +1

    Hi, thank you for this tutorial, could you please let me know if you can make a tutorial on how to plot for indian districts and where would we get the geojson file for indian districts.

  • @rmttbj
    @rmttbj 4 роки тому

    Nice explanation. Thank you for your time and effort!

  • @isaacdada8933
    @isaacdada8933 2 роки тому

    I haven't been able to get past the fig.show(), it keeps popping the error:
    Error: could not locate runnable browser, any idea how to get past this?

  • @priyanshuvettori5179
    @priyanshuvettori5179 Рік тому

    Its been 2 days and I am trying to label data and name of state in every state.
    How to do that??

  • @gauravkadam7039
    @gauravkadam7039 2 роки тому

    hello
    need help, I have the map of India and have to know which color is there on every state and every color have the no and the map don't have names of state we have to get that using lat and long using python

  • @chandrashekharbagul5825
    @chandrashekharbagul5825 Рік тому

    I did all the steps as shown in the video but it is showing me the following error in jupyter notebook:
    "Can't locate a browser with key in ('chrome', 'google-chrome')"
    It is chrome as it is my default browser

  • @bibekanandasahoo3497
    @bibekanandasahoo3497 2 роки тому

    Very useful vidio sir
    I need a help, I need geo json file for indian cricket stadium, I searched on google but dont find any please help where I can find this json file.

  • @taddelepetros8106
    @taddelepetros8106 3 роки тому

    how can i create this choropleth map in html division

  • @menakarajapaksha7963
    @menakarajapaksha7963 Рік тому +1

    Thank you very much ❤❤❤

  • @jakekerman7568
    @jakekerman7568 4 роки тому +3

    Great video! Is there a way to plot points based on lat/lon over a map like the one you created?

  • @CourseCreatorsCollective
    @CourseCreatorsCollective 3 роки тому

    So systematic, Brilliant..

  • @citizengaming3138
    @citizengaming3138 2 роки тому

    In cell 23 you have written goes instead of geos
    Still code is running!
    How 🤷‍♂️?

  • @vivekgediya8906
    @vivekgediya8906 3 роки тому

    Thank you so much for this tutorial video! Very helpful for my project. ❤️

  • @navneetgupta2474
    @navneetgupta2474 3 роки тому

    I need a help, I need a map specific to india, on which I want to plot scatters...

  • @rebornbright
    @rebornbright 2 роки тому

    This is such a great video, thanks for sharing! Please do more videos on geospatial data with python🙏

  • @ahmadasgharianrezaei6846
    @ahmadasgharianrezaei6846 4 роки тому

    Well done on this tutorial,
    It was very helpful and clever.

  • @sanjugang12
    @sanjugang12 3 роки тому

    is there any way to label the state names instead of using hover_name??

  • @psgvmajorproject9661
    @psgvmajorproject9661 3 роки тому

    what will be the renderers name if I use microsoft edge

  • @I2SEEYOU
    @I2SEEYOU 4 роки тому

    I am facing an issue in plotting another map ..let me know where I can ping the issue,used the above method to plot

  • @jatinsharma8116
    @jatinsharma8116 2 роки тому

    Thanks for the great video

  • @alayetmanel6986
    @alayetmanel6986 3 роки тому +1

    Somehow when I try to load the Json file it doesn't read it :( how can I fix it

    • @Arbaaz12399
      @Arbaaz12399 3 роки тому

      how did you try read it in

    • @alayetmanel6986
      @alayetmanel6986 3 роки тому

      @@Arbaaz12399 well I used the same code at first but I couldn't load it after I used a
      With openurl ('url') as response:
      Tunisia=json.load(response)
      Print (Tunisia)
      And the other problem is I didn't get why you transformed the data ? I have a CSV that already has the same Id as the geojson file fo I need to do it 2 ? Coz I keep getting errors that has nothing to do with syntax so I'm not lost.

    • @Arbaaz12399
      @Arbaaz12399 3 роки тому

      @@alayetmanel6986 so is the Json file working now because for my project I had to modify the code slightly to make it work .

    • @alayetmanel6986
      @alayetmanel6986 3 роки тому

      @@Arbaaz12399 yep it worked now I want to learn how to build a dashboard using multiple graphics can you elaborate this with the plotly I kinda find dash callbacks hard to understand thank you

  • @ghanshyamsharma8042
    @ghanshyamsharma8042 2 роки тому

    Thanks for this video. Is this map available at the district level in India?

  • @Arbaaz12399
    @Arbaaz12399 4 роки тому +1

    when i try run this pio.renderers.format = 'chrome', i keep getting this error "str' object has no attribute 'default'". Anyone know how i can fix this ?

    • @varunnayyar3138
      @varunnayyar3138 3 роки тому

      chrome is not the keyword i think
      same issue

  • @creativethree1737
    @creativethree1737 4 роки тому

    Plotly graph is displayed as blank in Jupyter notebook ,but when I save the image I can see it.Anyone knows how to fix this?

  • @shailesh1981able
    @shailesh1981able 2 роки тому

    Awesome!!

  • @deb1995
    @deb1995 2 роки тому

    why are you using geojson.Let me know how we can build it without geojson

  • @ashankdavid
    @ashankdavid Рік тому

    my df['id'] = df['State or Union Territory'].apply(lambda x: state_id_map[x]) is not working can u help please it says KeyError: 'Jammu and Kashmir'

    • @AkashKacha_
      @AkashKacha_ 5 місяців тому

      change the name to Jammu & Kashmir

  • @shubhamanand576
    @shubhamanand576 3 роки тому

    I'm having problem while adding df [id] with error Jammu and Kashmir..what shall I Do?

    • @felipeveiga2014
      @felipeveiga2014 3 роки тому

      You should replace the 'and' for the '&' sign.
      The Wikipedia table has been updated since the video recording. So some of its data won't be compatible with the GEOJSON one. You will have to rename some of the states names.

  • @adityanjsg99
    @adityanjsg99 3 роки тому

    Using .shp file or a shape file turns out to be lot easier. BUT I loved the way you wrote the code as you are explaning, that is Perfecton!!

  • @manthanmistry1205
    @manthanmistry1205 Рік тому

    This is the most useful video over choropleth maps but I've came across a problem where my map shows up with legend color bar but the map is not showing colours and I don't have any error message as well. If anyone can help that would be appreciated ❤

  • @rahulsoni007
    @rahulsoni007 4 роки тому +1

    Hello, is this map is correct? ladahak and jaamu are separated UT now. can anyone provide latest geo json of india?

    • @riasigtia5293
      @riasigtia5293 3 роки тому

      Hi, did you find it? I want it too.

    • @rahulsoni007
      @rahulsoni007 3 роки тому

      @@riasigtia5293 yes, i created actually

    • @riasigtia5293
      @riasigtia5293 3 роки тому

      @@rahulsoni007 how ? Can you share the JSON file

    • @riasigtia5293
      @riasigtia5293 3 роки тому

      @@rahulsoni007 srsubodh@mitaoe.ac.in

  • @sergioalejandrogodinezfern918
    @sergioalejandrogodinezfern918 4 роки тому

    Great video, so Can I ask you something?, I have a problem about the use of this library when I try to use an especial polygon data for geojson file, the result of the plot can not show the complete polygon, just shows a rectangle which hide the other polygons with a background color, so How can I configure this for showing the only polygon that I need like a states in your example, Thanks for your attention, best regards.

  • @animeshkumar6284
    @animeshkumar6284 Рік тому

    the map is not specifying state and do not shows data

  • @canancetin7897
    @canancetin7897 4 роки тому

    It's a great tutorial, thank you!

  • @krrishkundu4343
    @krrishkundu4343 3 роки тому

    @indian Pythonista..i have one question..what if I want to show the output in Google chrome instead of firefox??
    I have searched over the internet but I cannot find it . could you please help me in this regard

    • @psgvmajorproject9661
      @psgvmajorproject9661 3 роки тому

      just type "chrome"

    • @krrishkundu4343
      @krrishkundu4343 3 роки тому +1

      @@psgvmajorproject9661 ..Thank you...i have done it ..but its not coming..so I have decided not to run the code plotly.io. instead it is showing the output on jupyter notebook itself

    • @psgvmajorproject9661
      @psgvmajorproject9661 3 роки тому

      Hey bro. I tried what you told, but if I remove that code and just run fig.show() it gives me an error. Shows that couldn’t locate runnable browser. Can you help me

    • @krrishkundu4343
      @krrishkundu4343 3 роки тому

      @@psgvmajorproject9661 ..how can I show you over here..you can send me your email..I can forward the jupyter notebook file

  • @khalidsultani1896
    @khalidsultani1896 2 роки тому

    thanks for posting

  • @mohammadadaileh6218
    @mohammadadaileh6218 2 роки тому

    very good video! thanks

  • @mohammadrachman1344
    @mohammadrachman1344 3 роки тому

    thank you from indonesia

  • @nellypokam6737
    @nellypokam6737 3 роки тому

    Thank you 😀

  • @anirudhreddy7671
    @anirudhreddy7671 4 роки тому +4

    bro write a medium blog explaining your videos themselves, and embed UA-cam videos into that blog. You will get more traffic

  • @stoufa
    @stoufa 3 роки тому

    Thanks for sharing 😊

  • @atharvakatre3256
    @atharvakatre3256 4 роки тому +1

    Thanks I made a choropleth map of India for covid 19 cases with the help of this video. But the plot output is very resource intensive I get memory error on Jupyter, however it runs fine on Google Collab. But I want to embed this map on a webpage but it takes infinite time for loading, other plots open quickly except for this one. Any kind of help is appreciated!!

  • @terraflops
    @terraflops 4 роки тому

    in the future could you leave comments in your notebook code of what your code is doing? Thanks for the GitHub link!

  • @NishantDixit
    @NishantDixit 4 роки тому

    Thanks bro this really helped!!

  • @thetpainghmoo5616
    @thetpainghmoo5616 4 роки тому

    It is very useful for me

  • @pinakipb2
    @pinakipb2 4 роки тому

    May I know which OS do you use? Is it in Virtualbox?

    • @IndianPythonista
      @IndianPythonista  4 роки тому +1

      It's Ubuntu 18.04. Not in virtual box.

    • @pinakipb2
      @pinakipb2 4 роки тому

      @@IndianPythonista Can you pls make a video on how you customized Ubuntu?

  • @vishnujatav6329
    @vishnujatav6329 3 роки тому

    Nice video

  • @nzdeepak
    @nzdeepak 4 роки тому

    Nice on bro!

  • @allankummanadil6298
    @allankummanadil6298 2 роки тому +1

    Not explained the for loop well at all, whats the point of the rest of the video?
    df["id"] = df["State or union territory"].apply(lambda x: state_id_map[x]) - just isnt working? Gives me error: KeyError: 'Arunachal Pradesh'
    Waste of time, not clearly explained

  •  4 роки тому

    Nice!! video

  • @miromati
    @miromati 2 роки тому

    thanks :)

  • @NomanSaleem
    @NomanSaleem 4 роки тому

    love you

  • @لنتسقطامةرسولهامحمدوصاحبهعمرال

    i love you brother....i learn a lot of from....can you do a video how to convert blob url of video or image to mp4 ......thanks alot of Sir ...god bless you

  • @nehasingh-px7ru
    @nehasingh-px7ru 4 роки тому

    Sir plz provide your email i have some queries

  • @battlefox3294
    @battlefox3294 4 роки тому

    Sir plz accept my request in LinkedIn,. I need help
    Thanks

  • @AdityaMaheshRane
    @AdityaMaheshRane 7 днів тому

    Worst explanation. Unneceserrality makingeasy topic difficult my doing some bullshit state id map and whatnot!