{
  "id": 194733,
  "title": "Hold ON! Something doesn't feel right",
  "url": "/competitions/cdp-unlocking-climate-solutions/discussion/194733",
  "author_name": "",
  "post_date": "2020-11-02T12:53:16.979085100Z",
  "votes": null,
  "comment_count": 3,
  "views": 0,
  "content": "<p>I'm pretty sure I made a mistake here, however, have a look: </p>\n<ol>\n<li>CITY_DISCLOSING is a dataframe that is stacked using city_disclosing-2018,2019 and 2020 data frames(VERTICALLY). It's one big dataframe.</li>\n</ol>\n<p>So, basically, I aim to extract the top 10 most populous countries of the world and plot them using Choropleth world maps.</p>\n<hr>\n<p>CODE</p>\n<p>top_10_most = city_disclosing.sort_values('Population', ascending = False)[:10]</p>\n<p>fig = make_subplots(rows = 1, cols = 1, <br>\n                   specs = [[{'type' : 'choropleth'} for column in np.arange(1)]for row in np.arange(1)],<br>\n                   subplot_titles = ['Country V Population'])<br>\nfig.add_trace(go.Choropleth(locations = top_10_most.Country,<br>\n                            z = top_10_most.Population,<br>\n                            locationmode = 'country names',<br>\n                            colorscale = px.colors.sequential.Viridis),<br>\n             row = 1, col = 1)</p>\n<hr>\n<p>This appears right to me.</p>\n<p>The output was  : </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2F93ba988479287aa45988785e3225ad13%2Fnewplot%20(1).png?generation=1604321434065801&amp;alt=media\" alt=\"\"></p>\n<p>As you can see neither China nor India - BOTH COUNTRIES CRAZY POPULATION WISE - aren't even highlighted on the map. </p>\n<p><strong>Is there something wrong with the data??</strong></p>",
  "messages": [
    {
      "id": "1067285",
      "postDate": "11/02/2020 12:53:16",
      "content": "<p>I'm pretty sure I made a mistake here, however, have a look: </p>\n<ol>\n<li>CITY_DISCLOSING is a dataframe that is stacked using city_disclosing-2018,2019 and 2020 data frames(VERTICALLY). It's one big dataframe.</li>\n</ol>\n<p>So, basically, I aim to extract the top 10 most populous countries of the world and plot them using Choropleth world maps.</p>\n<hr>\n<p>CODE</p>\n<p>top_10_most = city_disclosing.sort_values('Population', ascending = False)[:10]</p>\n<p>fig = make_subplots(rows = 1, cols = 1, <br>\n                   specs = [[{'type' : 'choropleth'} for column in np.arange(1)]for row in np.arange(1)],<br>\n                   subplot_titles = ['Country V Population'])<br>\nfig.add_trace(go.Choropleth(locations = top_10_most.Country,<br>\n                            z = top_10_most.Population,<br>\n                            locationmode = 'country names',<br>\n                            colorscale = px.colors.sequential.Viridis),<br>\n             row = 1, col = 1)</p>\n<hr>\n<p>This appears right to me.</p>\n<p>The output was  : </p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2F93ba988479287aa45988785e3225ad13%2Fnewplot%20(1).png?generation=1604321434065801&amp;alt=media\" alt=\"\"></p>\n<p>As you can see neither China nor India - BOTH COUNTRIES CRAZY POPULATION WISE - aren't even highlighted on the map. </p>\n<p><strong>Is there something wrong with the data??</strong></p>",
      "rawMarkdown": "I'm pretty sure I made a mistake here, however, have a look: \n\n1. CITY_DISCLOSING is a dataframe that is stacked using city_disclosing-2018,2019 and 2020 data frames(VERTICALLY). It's one big dataframe.\n\nSo, basically, I aim to extract the top 10 most populous countries of the world and plot them using Choropleth world maps.\n\n--------------------------------------------\nCODE\n\ntop_10_most = city_disclosing.sort_values('Population', ascending = False)[:10]\n\nfig = make_subplots(rows = 1, cols = 1, \n                   specs = [[{'type' : 'choropleth'} for column in np.arange(1)]for row in np.arange(1)],\n                   subplot_titles = ['Country V Population'])\nfig.add_trace(go.Choropleth(locations = top_10_most.Country,\n                            z = top_10_most.Population,\n                            locationmode = 'country names',\n                            colorscale = px.colors.sequential.Viridis),\n             row = 1, col = 1)\n\n--------------------------------------------------\n\nThis appears right to me.\n\nThe output was  : \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2F93ba988479287aa45988785e3225ad13%2Fnewplot%20(1).png?generation=1604321434065801&alt=media)\n\nAs you can see neither China nor India - BOTH COUNTRIES CRAZY POPULATION WISE - aren't even highlighted on the map. \n\n**Is there something wrong with the data??**",
      "votes": null
    },
    {
      "id": "1067523",
      "postDate": "11/02/2020 15:14:14",
      "content": "<p>There should be data for at least 6 cities in China and 13 cities in India.  If you share a link to a public notebook then it will be much easier to help you to troubleshoot your code.  </p>",
      "rawMarkdown": "There should be data for at least 6 cities in China and 13 cities in India.  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": "1067552",
      "postDate": "11/02/2020 15:27:25",
      "content": "<p>Here you go : </p>\n<p><strong><a href=\"https://www.kaggle.com/fireheart7/city-disclosing-eda\" target=\"_blank\">https://www.kaggle.com/fireheart7/city-disclosing-eda</a></strong></p>",
      "rawMarkdown": "Here you go : \n\n**https://www.kaggle.com/fireheart7/city-disclosing-eda**",
      "votes": null
    },
    {
      "id": "1067603",
      "postDate": "11/02/2020 15:45:53",
      "content": "<p>You can find some cities in India by adding the following line to code cell #8:</p>\n<pre><code>city_disclosing = city_disclosing[city_disclosing['Country']=='India'] \ncity_disclosing.head(15)\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1314380%2F57273f5a4ab1fcb091d7d19e3ab3a65b%2FScreen%20Shot%202020-11-02%20at%208.43.46%20AM.png?generation=1604331844954054&amp;alt=media\" alt=\"\"></p>\n<p>Whereas it looks like maybe you are only plotting the 10 largest cities on your map due to the inclusion of the following line: </p>\n<pre><code>top_10_most = city_disclosing.sort_values('Population', ascending = False)[:10]\n</code></pre>",
      "rawMarkdown": "You can find some cities in India by adding the following line to code cell #8:\n\n```\ncity_disclosing = city_disclosing[city_disclosing['Country']=='India'] \ncity_disclosing.head(15)\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1314380%2F57273f5a4ab1fcb091d7d19e3ab3a65b%2FScreen%20Shot%202020-11-02%20at%208.43.46%20AM.png?generation=1604331844954054&alt=media)\n\nWhereas it looks like maybe you are only plotting the 10 largest cities on your map due to the inclusion of the following line: \n\n```\ntop_10_most = city_disclosing.sort_values('Population', ascending = False)[:10]\n\n```",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1067523,
      "author_name": "paultimothymooney",
      "author_url": "",
      "post_date": "11/02/2020 15:14:14",
      "content": "<p>There should be data for at least 6 cities in China and 13 cities in India.  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": 1067552,
          "author_name": "fireheart7",
          "author_url": "",
          "post_date": "11/02/2020 15:27:25",
          "content": "<p>Here you go : </p>\n<p><strong><a href=\"https://www.kaggle.com/fireheart7/city-disclosing-eda\" target=\"_blank\">https://www.kaggle.com/fireheart7/city-disclosing-eda</a></strong></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1067603,
          "author_name": "paultimothymooney",
          "author_url": "",
          "post_date": "11/02/2020 15:45:53",
          "content": "<p>You can find some cities in India by adding the following line to code cell #8:</p>\n<pre><code>city_disclosing = city_disclosing[city_disclosing['Country']=='India'] \ncity_disclosing.head(15)\n</code></pre>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1314380%2F57273f5a4ab1fcb091d7d19e3ab3a65b%2FScreen%20Shot%202020-11-02%20at%208.43.46%20AM.png?generation=1604331844954054&amp;alt=media\" alt=\"\"></p>\n<p>Whereas it looks like maybe you are only plotting the 10 largest cities on your map due to the inclusion of the following line: </p>\n<pre><code>top_10_most = city_disclosing.sort_values('Population', ascending = False)[:10]\n</code></pre>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1067285": "I'm pretty sure I made a mistake here, however, have a look: \n\n1. CITY_DISCLOSING is a dataframe that is stacked using city_disclosing-2018,2019 and 2020 data frames(VERTICALLY). It's one big dataframe.\n\nSo, basically, I aim to extract the top 10 most populous countries of the world and plot them using Choropleth world maps.\n\n--------------------------------------------\nCODE\n\ntop_10_most = city_disclosing.sort_values('Population', ascending = False)[:10]\n\nfig = make_subplots(rows = 1, cols = 1, \n                   specs = [[{'type' : 'choropleth'} for column in np.arange(1)]for row in np.arange(1)],\n                   subplot_titles = ['Country V Population'])\nfig.add_trace(go.Choropleth(locations = top_10_most.Country,\n                            z = top_10_most.Population,\n                            locationmode = 'country names',\n                            colorscale = px.colors.sequential.Viridis),\n             row = 1, col = 1)\n\n--------------------------------------------------\n\nThis appears right to me.\n\nThe output was  : \n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F2599569%2F93ba988479287aa45988785e3225ad13%2Fnewplot%20(1).png?generation=1604321434065801&alt=media)\n\nAs you can see neither China nor India - BOTH COUNTRIES CRAZY POPULATION WISE - aren't even highlighted on the map. \n\n**Is there something wrong with the data??**",
    "1067523": "There should be data for at least 6 cities in China and 13 cities in India.  If you share a link to a public notebook then it will be much easier to help you to troubleshoot your code.",
    "1067552": "Here you go : \n\n**https://www.kaggle.com/fireheart7/city-disclosing-eda**",
    "1067603": "You can find some cities in India by adding the following line to code cell #8:\n\n```\ncity_disclosing = city_disclosing[city_disclosing['Country']=='India'] \ncity_disclosing.head(15)\n```\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F1314380%2F57273f5a4ab1fcb091d7d19e3ab3a65b%2FScreen%20Shot%202020-11-02%20at%208.43.46%20AM.png?generation=1604331844954054&alt=media)\n\nWhereas it looks like maybe you are only plotting the 10 largest cities on your map due to the inclusion of the following line: \n\n```\ntop_10_most = city_disclosing.sort_values('Population', ascending = False)[:10]\n\n```"
  },
  "source": "meta"
}