{
  "id": 194360,
  "title": "Problem with Choropleth Visualization",
  "url": "/competitions/cdp-unlocking-climate-solutions/discussion/194360",
  "author_name": "",
  "post_date": "2020-11-01T12:22:28.850990700Z",
  "votes": 1,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Hi all, <br>\nI seem to have been stuck at a turn and would really appreciate some assistance. </p>\n<p>So, I was trying to analyze population distribution V countries using the state of the at Choropleth maps, however, there is something wrong with the output every time.</p>\n<p><strong>Dataframe</strong> : </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2Fcecf5abbfe3e677b2f4f5c99c10de2f2%2FScreenshot%20(15).png?generation=1604233291727052&amp;alt=media\" alt=\"\"></p>\n<p><strong>Code Snippet</strong> :</p>\n<p>plt.figure(figsize = (20, 12))<br>\nchoropleth_population = px.choropleth(population_data, locations = population_data['Country'], <br>\n                                        color = population_data['Population'], hover_name = population_data['City'], <br>\n                                       scope = 'world', width = 900, height = 900, <br>\n                                        color_continuous_scale = px.colors.sequential.Viridis)<br>\nchoropleth_population.show()</p>\n<p><strong>Output</strong> : </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2F9b83b5d8a25a83d340ae4ed81bea889d%2FScreenshot%20(16).png?generation=1604233141234317&amp;alt=media\" alt=\"\"></p>\n<p>What's going wrong? The world map seems empty with no areas highlighted by the population statistic.</p>",
  "messages": [
    {
      "id": "1066175",
      "postDate": "11/01/2020 12:22:28",
      "content": "<p>Hi all, <br>\nI seem to have been stuck at a turn and would really appreciate some assistance. </p>\n<p>So, I was trying to analyze population distribution V countries using the state of the at Choropleth maps, however, there is something wrong with the output every time.</p>\n<p><strong>Dataframe</strong> : </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2Fcecf5abbfe3e677b2f4f5c99c10de2f2%2FScreenshot%20(15).png?generation=1604233291727052&amp;alt=media\" alt=\"\"></p>\n<p><strong>Code Snippet</strong> :</p>\n<p>plt.figure(figsize = (20, 12))<br>\nchoropleth_population = px.choropleth(population_data, locations = population_data['Country'], <br>\n                                        color = population_data['Population'], hover_name = population_data['City'], <br>\n                                       scope = 'world', width = 900, height = 900, <br>\n                                        color_continuous_scale = px.colors.sequential.Viridis)<br>\nchoropleth_population.show()</p>\n<p><strong>Output</strong> : </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2F9b83b5d8a25a83d340ae4ed81bea889d%2FScreenshot%20(16).png?generation=1604233141234317&amp;alt=media\" alt=\"\"></p>\n<p>What's going wrong? The world map seems empty with no areas highlighted by the population statistic.</p>",
      "rawMarkdown": "Hi all, \nI seem to have been stuck at a turn and would really appreciate some assistance. \n\nSo, I was trying to analyze population distribution V countries using the state of the at Choropleth maps, however, there is something wrong with the output every time.\n\n**Dataframe** : \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2Fcecf5abbfe3e677b2f4f5c99c10de2f2%2FScreenshot%20(15).png?generation=1604233291727052&alt=media)\n\n**Code Snippet** :\n\nplt.figure(figsize = (20, 12))\nchoropleth_population = px.choropleth(population_data, locations = population_data['Country'], \n                                        color = population_data['Population'], hover_name = population_data['City'], \n                                       scope = 'world', width = 900, height = 900, \n                                        color_continuous_scale = px.colors.sequential.Viridis)\nchoropleth_population.show()\n\n**Output** : \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2F9b83b5d8a25a83d340ae4ed81bea889d%2FScreenshot%20(16).png?generation=1604233141234317&alt=media)\n\nWhat's going wrong? The world map seems empty with no areas highlighted by the population statistic.",
      "votes": null
    },
    {
      "id": "1066250",
      "postDate": "11/01/2020 14:37:13",
      "content": "<p>If you share a link to a public notebook then it will be much easier to help you to troubleshoot your code.</p>",
      "rawMarkdown": "If you share a link to a public notebook then it will be much easier to help you to troubleshoot your code.",
      "votes": null
    },
    {
      "id": "1069976",
      "postDate": "11/05/2020 07:14:44",
      "content": "<p>Hi Aditya,<br>\nAdd the locationmode = 'country names' parameter to match entries in locations to regions on the map.</p>\n<p><code>plt.figure(figsize = (20, 12))\nchoropleth_population = px.choropleth(population_data, locations = population_data['Country'],\nlocationmode='country names',\ncolor = population_data['Population'], hover_name = population_data['City'],\nscope = 'world', width = 900, height = 900,\ncolor_continuous_scale = px.colors.sequential.Viridis)\nchoropleth_population.show()</code></p>",
      "rawMarkdown": "Hi Aditya,\nAdd the locationmode = 'country names' parameter to match entries in locations to regions on the map.\n\n`plt.figure(figsize = (20, 12))\nchoropleth_population = px.choropleth(population_data, locations = population_data['Country'],\nlocationmode='country names',\ncolor = population_data['Population'], hover_name = population_data['City'],\nscope = 'world', width = 900, height = 900,\ncolor_continuous_scale = px.colors.sequential.Viridis)\nchoropleth_population.show()`",
      "votes": null
    },
    {
      "id": "1070156",
      "postDate": "11/05/2020 12:50:29",
      "content": "<p>thank you!</p>",
      "rawMarkdown": "thank you!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1066250,
      "author_name": "paultimothymooney",
      "author_url": "",
      "post_date": "11/01/2020 14:37:13",
      "content": "<p>If you share a link to a public notebook then it will be much easier to help you to troubleshoot your code.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1069976,
      "author_name": "kavisekar",
      "author_url": "",
      "post_date": "11/05/2020 07:14:44",
      "content": "<p>Hi Aditya,<br>\nAdd the locationmode = 'country names' parameter to match entries in locations to regions on the map.</p>\n<p><code>plt.figure(figsize = (20, 12))\nchoropleth_population = px.choropleth(population_data, locations = population_data['Country'],\nlocationmode='country names',\ncolor = population_data['Population'], hover_name = population_data['City'],\nscope = 'world', width = 900, height = 900,\ncolor_continuous_scale = px.colors.sequential.Viridis)\nchoropleth_population.show()</code></p>",
      "votes": null,
      "replies": [
        {
          "id": 1070156,
          "author_name": "fireheart7",
          "author_url": "",
          "post_date": "11/05/2020 12:50:29",
          "content": "<p>thank you!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1066175": "Hi all, \nI seem to have been stuck at a turn and would really appreciate some assistance. \n\nSo, I was trying to analyze population distribution V countries using the state of the at Choropleth maps, however, there is something wrong with the output every time.\n\n**Dataframe** : \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2Fcecf5abbfe3e677b2f4f5c99c10de2f2%2FScreenshot%20(15).png?generation=1604233291727052&alt=media)\n\n**Code Snippet** :\n\nplt.figure(figsize = (20, 12))\nchoropleth_population = px.choropleth(population_data, locations = population_data['Country'], \n                                        color = population_data['Population'], hover_name = population_data['City'], \n                                       scope = 'world', width = 900, height = 900, \n                                        color_continuous_scale = px.colors.sequential.Viridis)\nchoropleth_population.show()\n\n**Output** : \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2F9b83b5d8a25a83d340ae4ed81bea889d%2FScreenshot%20(16).png?generation=1604233141234317&alt=media)\n\nWhat's going wrong? The world map seems empty with no areas highlighted by the population statistic.",
    "1066250": "If you share a link to a public notebook then it will be much easier to help you to troubleshoot your code.",
    "1069976": "Hi Aditya,\nAdd the locationmode = 'country names' parameter to match entries in locations to regions on the map.\n\n`plt.figure(figsize = (20, 12))\nchoropleth_population = px.choropleth(population_data, locations = population_data['Country'],\nlocationmode='country names',\ncolor = population_data['Population'], hover_name = population_data['City'],\nscope = 'world', width = 900, height = 900,\ncolor_continuous_scale = px.colors.sequential.Viridis)\nchoropleth_population.show()`",
    "1070156": "thank you!"
  },
  "source": "meta"
}