How to plot US 2020 elections with plotly

Поделиться
HTML-код
  • Опубликовано: 5 фев 2025
  • hello everyone, in this video we will use plotly express to plot a choropleth map showing the US 2020 Elections results.
    Interested in learning Python, checkout the beginner Python courses here
    How to Build GUI Apps with Python and Tkinter
    www.udemy.com/...
    Learn Python From Scratch and Build 10 Programs
    www.udemy.com/...
    A Practical Guide to Coding With Python
    www.udemy.com/...

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

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

    Thanks a lot great video and finally explained/written in easy understandable way(not like a lot of others that are over complicated ). Much appreciated helped a lot with my own US election project!

    • @101touchapps
      @101touchapps  4 года назад

      Thanks Richard, am glad i could help

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

    Thank you very much for this wonderful video. You helped me a lot.

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

    Not a single person is able to add annotations on the states like the name amd the data.

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

      I added state names that appear on the map, so it visually displays the abbreviation for each state:
      # add state abbreviations
      fig.add_scattergeo(
      locations=data_for_map['id'],
      locationmode='USA-states',
      text=data_for_map['id'],
      mode='text',
      textfont=dict(
      color='white',
      ))
      You can add this before doing fig.show()

  • @NachiketKumarSingh
    @NachiketKumarSingh 2 года назад +1

    Why couldn't you write locations= 'state' in place of 'usa_state_code'

    • @101touchapps
      @101touchapps  2 года назад

      well that's another way to do it! will try it out.