Plotting Choropleth Maps using Python (Plotly)

Поделиться
HTML-код
  • Опубликовано: 23 окт 2024

Комментарии • 102

  • @IndianPythonista
    @IndianPythonista  4 года назад +6

    Code: github.com/nikhilkumarsingh/choropleth-python-tutorial
    Reading Wikipedia Tables using Python: ruclips.net/video/7NmBCUOIYPk/видео.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 года назад +11

    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!!

  • @leonardomolina8958
    @leonardomolina8958 4 года назад +3

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

  • @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

  • @felipeveiga2014
    @felipeveiga2014 2 года назад +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.

  • @faroozrimaaz7092
    @faroozrimaaz7092 Год назад

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

  • @sameerkumarsarmaannadanam3352
    @sameerkumarsarmaannadanam3352 3 года назад

    Nice demonstration of px mapping capabilities. Thanks!

  • @PaulaArias-he4ug
    @PaulaArias-he4ug 6 месяцев назад

    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?

  • @pinakipb2
    @pinakipb2 4 года назад +2

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

  • @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?

  • @jakekerman7568
    @jakekerman7568 3 года назад +3

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

  • @sreeramraj4791
    @sreeramraj4791 Год назад

    Excellent Video.. keep up the good work bro!

  • @rebornbright
    @rebornbright 2 года назад

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

  • @oluwaseunodibo1395
    @oluwaseunodibo1395 3 года назад

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

  • @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

  • @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!!

  • @ghanshyamsharma8042
    @ghanshyamsharma8042 2 года назад

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

  • @JiahuiChen-p1c
    @JiahuiChen-p1c Год назад

    Great video, thanks for making it!

  • @rmttbj
    @rmttbj 3 года назад

    Nice explanation. Thank you for your time and effort!

  • @vivekgediya8906
    @vivekgediya8906 3 года назад

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

  • @menakarajapaksha7963
    @menakarajapaksha7963 Год назад +1

    Thank you very much ❤❤❤

  • @puspendurana7501
    @puspendurana7501 7 месяцев назад

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

  • @karankumarify
    @karankumarify 2 года назад +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.

  • @dizumadhukalya7750
    @dizumadhukalya7750 Месяц назад

    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.

  • @ahmadasgharianrezaei6846
    @ahmadasgharianrezaei6846 4 года назад

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

  • @businessrunner3037
    @businessrunner3037 4 года назад +1

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

  • @anirudhreddy7671
    @anirudhreddy7671 4 года назад +4

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

  • @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.

  • @CourseCreatorsCollective
    @CourseCreatorsCollective 2 года назад

    So systematic, Brilliant..

  • @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.

  • @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.

  • @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

  • @jatinsharma8116
    @jatinsharma8116 2 года назад

    Thanks for the great video

  • @I2SEEYOU
    @I2SEEYOU 3 года назад

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

  • @TarunSharma-jb4dh
    @TarunSharma-jb4dh 2 года назад

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

  • @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?

  • @FRUXT
    @FRUXT 2 года назад

    Thank you so much ! ( from France ^^)

  • @citizengaming3138
    @citizengaming3138 2 года назад

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

  • @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

  • @kanupriyaarora7501
    @kanupriyaarora7501 3 года назад +1

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

  • @sanjugang12
    @sanjugang12 3 года назад

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

  • @manthanmistry1205
    @manthanmistry1205 10 месяцев назад

    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 ❤

  • @SruthiSrinivas-b9o
    @SruthiSrinivas-b9o 10 месяцев назад

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

  • @deb1995
    @deb1995 2 года назад

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

  • @khalidsultani1896
    @khalidsultani1896 2 года назад

    thanks for posting

  • @priyanshuvettori5179
    @priyanshuvettori5179 10 месяцев назад

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

  • @prinithjeffrey2004
    @prinithjeffrey2004 Год назад

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

  • @navneetgupta2474
    @navneetgupta2474 3 года назад

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

  • @atharvakatre3256
    @atharvakatre3256 4 года назад

    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!!

  • @shailesh1981able
    @shailesh1981able 2 года назад

    Awesome!!

  • @mohammadadaileh6218
    @mohammadadaileh6218 2 года назад

    very good video! thanks

  • @nellypokam6737
    @nellypokam6737 2 года назад

    Thank you 😀

  • @canancetin7897
    @canancetin7897 4 года назад

    It's a great tutorial, thank you!

  • @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_ 3 месяца назад

      change the name to Jammu & Kashmir

  • @mohammadrachman1344
    @mohammadrachman1344 2 года назад

    thank you from indonesia

  • @stoufa
    @stoufa 3 года назад

    Thanks for sharing 😊

  • @Arbaaz12399
    @Arbaaz12399 3 года назад +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

  • @taddelepetros8106
    @taddelepetros8106 3 года назад

    how can i create this choropleth map in html division

  • @psgvmajorproject9661
    @psgvmajorproject9661 3 года назад

    what will be the renderers name if I use microsoft edge

  • @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?

  • @shubhamanand576
    @shubhamanand576 2 года назад

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

    • @felipeveiga2014
      @felipeveiga2014 2 года назад

      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.

  • @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

  • @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?

  • @thetpainghmoo5616
    @thetpainghmoo5616 4 года назад

    It is very useful for me

  • @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

  • @rahulsoni007
    @rahulsoni007 3 года назад +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

  • @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!!

  • @animeshkumar6284
    @animeshkumar6284 Год назад

    the map is not specifying state and do not shows data

  • @vishnujatav6329
    @vishnujatav6329 3 года назад

    Nice video

  • @miromati
    @miromati 2 года назад

    thanks :)

  • @nzdeepak
    @nzdeepak 4 года назад

    Nice on bro!

  •  4 года назад

    Nice!! video

  • @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

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

    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

  • @NomanSaleem
    @NomanSaleem 3 года назад

    love you

  • @battlefox3294
    @battlefox3294 4 года назад

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

  • @nehasingh-px7ru
    @nehasingh-px7ru 4 года назад

    Sir plz provide your email i have some queries