diff --git "a/US_Population.ipynb" "b/US_Population.ipynb" new file mode 100644--- /dev/null +++ "b/US_Population.ipynb" @@ -0,0 +1,7287 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# US Population Data" + ], + "metadata": { + "id": "PJ6eW22LJM_n" + } + }, + { + "cell_type": "markdown", + "source": [ + "Chanin Nantasenamat, Ph.D." + ], + "metadata": { + "id": "qPXtYV6tLA7v" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Load data" + ], + "metadata": { + "id": "xHx4uFrkJQTE" + } + }, + { + "cell_type": "code", + "source": [ + "import pandas as pd\n", + "\n", + "df = pd.read_csv('https://raw.githubusercontent.com/dataprofessor/dashboard-v3/master/data/us-population-2010-2019.csv')\n", + "df" + ], + "metadata": { + "id": "JETSZBjeJPR1", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "outputId": "a3ac07ff-60c5-4a39-87e8-d0944e759c65" + }, + "execution_count": 1, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " states id 2010 2011 2012 2013 \\\n", + "0 Alabama 1 4,785,437 4,799,069 4,815,588 4,830,081 \n", + "1 Alaska 2 713,910 722,128 730,443 737,068 \n", + "2 Arizona 4 6,407,172 6,472,643 6,554,978 6,632,764 \n", + "3 Arkansas 5 2,921,964 2,940,667 2,952,164 2,959,400 \n", + "4 California 6 37,319,502 37,638,369 37,948,800 38,260,787 \n", + "5 Colorado 8 5,047,349 5,121,108 5,192,647 5,269,035 \n", + "6 Connecticut 9 3,579,114 3,588,283 3,594,547 3,594,841 \n", + "7 Delaware 10 899,593 907,381 915,179 923,576 \n", + "8 District of Columbia 11 605,226 619,800 634,924 650,581 \n", + "9 Florida 12 18,845,537 19,053,237 19,297,822 19,545,621 \n", + "10 Georgia 13 9,711,881 9,802,431 9,901,430 9,972,479 \n", + "11 Hawaii 15 1,363,963 1,379,329 1,394,804 1,408,243 \n", + "12 Idaho 16 1,570,746 1,583,910 1,595,324 1,611,206 \n", + "13 Illinois 17 12,840,503 12,867,454 12,882,510 12,895,129 \n", + "14 Indiana 18 6,490,432 6,516,528 6,537,703 6,568,713 \n", + "15 Iowa 19 3,050,745 3,066,336 3,076,190 3,092,997 \n", + "16 Kansas 20 2,858,190 2,869,225 2,885,257 2,893,212 \n", + "17 Kentucky 21 4,348,181 4,369,821 4,386,346 4,404,659 \n", + "18 Louisiana 22 4,544,532 4,575,625 4,600,972 4,624,527 \n", + "19 Maine 23 1,327,629 1,328,284 1,327,729 1,328,009 \n", + "20 Maryland 24 5,788,645 5,839,419 5,886,992 5,923,188 \n", + "21 Massachusetts 25 6,566,307 6,613,583 6,663,005 6,713,315 \n", + "22 Michigan 26 9,877,510 9,882,412 9,897,145 9,913,065 \n", + "23 Minnesota 27 5,310,828 5,346,143 5,376,643 5,413,479 \n", + "24 Mississippi 28 2,970,548 2,978,731 2,983,816 2,988,711 \n", + "25 Missouri 29 5,995,974 6,010,275 6,024,367 6,040,715 \n", + "26 Montana 30 990,697 997,316 1,003,783 1,013,569 \n", + "27 Nebraska 31 1,829,542 1,840,672 1,853,303 1,865,279 \n", + "28 Nevada 32 2,702,405 2,712,730 2,743,996 2,775,970 \n", + "29 New Hampshire 33 1,316,762 1,320,202 1,324,232 1,326,622 \n", + "30 New Jersey 34 8,799,446 8,828,117 8,844,942 8,856,972 \n", + "31 New Mexico 35 2,064,552 2,080,450 2,087,309 2,092,273 \n", + "32 New York 36 19,399,878 19,499,241 19,572,932 19,624,447 \n", + "33 North Carolina 37 9,574,323 9,657,592 9,749,476 9,843,336 \n", + "34 North Dakota 38 674,715 685,225 701,176 722,036 \n", + "35 Ohio 39 11,539,336 11,544,663 11,548,923 11,576,684 \n", + "36 Oklahoma 40 3,759,944 3,788,379 3,818,814 3,853,214 \n", + "37 Oregon 41 3,837,491 3,872,036 3,899,001 3,922,468 \n", + "38 Pennsylvania 42 12,711,160 12,745,815 12,767,118 12,776,309 \n", + "39 Rhode Island 44 1,053,959 1,053,649 1,054,621 1,055,081 \n", + "40 South Carolina 45 4,635,649 4,671,994 4,717,354 4,764,080 \n", + "41 South Dakota 46 816,166 823,579 833,566 842,316 \n", + "42 Tennessee 47 6,355,311 6,399,291 6,453,898 6,494,340 \n", + "43 Texas 48 25,241,971 25,645,629 26,084,481 26,480,266 \n", + "44 Utah 49 2,775,332 2,814,384 2,853,375 2,897,640 \n", + "45 Vermont 50 625,879 627,049 626,090 626,210 \n", + "46 Virginia 51 8,023,699 8,101,155 8,185,080 8,252,427 \n", + "47 Washington 53 6,742,830 6,826,627 6,897,058 6,963,985 \n", + "48 West Virginia 54 1,854,239 1,856,301 1,856,872 1,853,914 \n", + "49 Wisconsin 55 5,690,475 5,705,288 5,719,960 5,736,754 \n", + "50 Wyoming 56 564,487 567,299 576,305 582,122 \n", + "51 Puerto Rico 72 3,721,525 3,678,732 3,634,488 3,593,077 \n", + "\n", + " 2014 2015 2016 2017 2018 2019 \n", + "0 4,841,799 4,852,347 4,863,525 4,874,486 4,887,681 4,903,185 \n", + "1 736,283 737,498 741,456 739,700 735,139 731,545 \n", + "2 6,730,413 6,829,676 6,941,072 7,044,008 7,158,024 7,278,717 \n", + "3 2,967,392 2,978,048 2,989,918 3,001,345 3,009,733 3,017,804 \n", + "4 38,596,972 38,918,045 39,167,117 39,358,497 39,461,588 39,512,223 \n", + "5 5,350,101 5,450,623 5,539,215 5,611,885 5,691,287 5,758,736 \n", + "6 3,594,524 3,587,122 3,578,141 3,573,297 3,571,520 3,565,287 \n", + "7 932,487 941,252 948,921 956,823 965,479 973,764 \n", + "8 662,328 675,400 685,815 694,906 701,547 705,749 \n", + "9 19,845,911 20,209,042 20,613,477 20,963,613 21,244,317 21,477,737 \n", + "10 10,067,278 10,178,447 10,301,890 10,410,330 10,511,131 10,617,423 \n", + "11 1,414,538 1,422,052 1,427,559 1,424,393 1,420,593 1,415,872 \n", + "12 1,631,112 1,651,059 1,682,380 1,717,715 1,750,536 1,787,065 \n", + "13 12,884,493 12,858,913 12,820,527 12,778,828 12,723,071 12,671,821 \n", + "14 6,593,644 6,608,422 6,634,304 6,658,078 6,695,497 6,732,219 \n", + "15 3,109,350 3,120,960 3,131,371 3,141,550 3,148,618 3,155,070 \n", + "16 2,900,475 2,909,011 2,910,844 2,908,718 2,911,359 2,913,314 \n", + "17 4,414,349 4,425,976 4,438,182 4,452,268 4,461,153 4,467,673 \n", + "18 4,644,013 4,664,628 4,678,135 4,670,560 4,659,690 4,648,794 \n", + "19 1,330,513 1,328,262 1,331,317 1,334,612 1,339,057 1,344,212 \n", + "20 5,957,283 5,985,562 6,003,323 6,023,868 6,035,802 6,045,680 \n", + "21 6,762,596 6,794,228 6,823,608 6,859,789 6,882,635 6,892,503 \n", + "22 9,929,848 9,931,715 9,950,571 9,973,114 9,984,072 9,986,857 \n", + "23 5,451,079 5,482,032 5,522,744 5,566,230 5,606,249 5,639,632 \n", + "24 2,990,468 2,988,471 2,987,938 2,988,510 2,981,020 2,976,149 \n", + "25 6,056,202 6,071,732 6,087,135 6,106,670 6,121,623 6,137,428 \n", + "26 1,021,869 1,030,475 1,040,859 1,052,482 1,060,665 1,068,778 \n", + "27 1,879,321 1,891,277 1,905,616 1,915,947 1,925,614 1,934,408 \n", + "28 2,817,628 2,866,939 2,917,563 2,969,905 3,027,341 3,080,156 \n", + "29 1,333,341 1,336,350 1,342,307 1,348,787 1,353,465 1,359,711 \n", + "30 8,864,525 8,867,949 8,870,827 8,885,525 8,886,025 8,882,190 \n", + "31 2,089,568 2,089,291 2,091,630 2,091,784 2,092,741 2,096,829 \n", + "32 19,651,049 19,654,666 19,633,428 19,589,572 19,530,351 19,453,561 \n", + "33 9,932,887 10,031,646 10,154,788 10,268,233 10,381,615 10,488,084 \n", + "34 737,401 754,066 754,434 754,942 758,080 762,062 \n", + "35 11,602,700 11,617,527 11,634,370 11,659,650 11,676,341 11,689,100 \n", + "36 3,878,187 3,909,500 3,926,331 3,931,316 3,940,235 3,956,971 \n", + "37 3,963,244 4,015,792 4,089,976 4,143,625 4,181,886 4,217,737 \n", + "38 12,788,313 12,784,826 12,782,275 12,787,641 12,800,922 12,801,989 \n", + "39 1,055,936 1,056,065 1,056,770 1,055,673 1,058,287 1,059,361 \n", + "40 4,823,617 4,891,938 4,957,968 5,021,268 5,084,156 5,148,714 \n", + "41 849,129 853,988 862,996 872,868 878,698 884,659 \n", + "42 6,541,223 6,591,170 6,646,010 6,708,799 6,771,631 6,829,174 \n", + "43 26,964,333 27,470,056 27,914,410 28,295,273 28,628,666 28,995,881 \n", + "44 2,936,879 2,981,835 3,041,868 3,101,042 3,153,550 3,205,958 \n", + "45 625,214 625,216 623,657 624,344 624,358 623,989 \n", + "46 8,310,993 8,361,808 8,410,106 8,463,587 8,501,286 8,535,519 \n", + "47 7,054,655 7,163,657 7,294,771 7,423,362 7,523,869 7,614,893 \n", + "48 1,849,489 1,842,050 1,831,023 1,817,004 1,804,291 1,792,147 \n", + "49 5,751,525 5,760,940 5,772,628 5,790,186 5,807,406 5,822,434 \n", + "50 582,531 585,613 584,215 578,931 577,601 578,759 \n", + "51 3,534,874 3,473,232 3,406,672 3,325,286 3,193,354 3,193,694 " + ], + "text/html": [ + "\n", + " <div id=\"df-3cb8d892-d5a2-4e9b-a6f6-1037200435f1\" class=\"colab-df-container\">\n", + " <div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>states</th>\n", + " <th>id</th>\n", + " <th>2010</th>\n", + " <th>2011</th>\n", + " <th>2012</th>\n", + " <th>2013</th>\n", + " <th>2014</th>\n", + " <th>2015</th>\n", + " <th>2016</th>\n", + " <th>2017</th>\n", + " <th>2018</th>\n", + " <th>2019</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>Alabama</td>\n", + " <td>1</td>\n", + " <td>4,785,437</td>\n", + " <td>4,799,069</td>\n", + " <td>4,815,588</td>\n", + " <td>4,830,081</td>\n", + " <td>4,841,799</td>\n", + " <td>4,852,347</td>\n", + " <td>4,863,525</td>\n", + " <td>4,874,486</td>\n", + " <td>4,887,681</td>\n", + " <td>4,903,185</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>Alaska</td>\n", + " <td>2</td>\n", + " <td>713,910</td>\n", + " <td>722,128</td>\n", + " <td>730,443</td>\n", + " <td>737,068</td>\n", + " <td>736,283</td>\n", + " <td>737,498</td>\n", + " <td>741,456</td>\n", + " <td>739,700</td>\n", + " <td>735,139</td>\n", + " <td>731,545</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <td>Arizona</td>\n", + " <td>4</td>\n", + " <td>6,407,172</td>\n", + " <td>6,472,643</td>\n", + " <td>6,554,978</td>\n", + " <td>6,632,764</td>\n", + " <td>6,730,413</td>\n", + " <td>6,829,676</td>\n", + " <td>6,941,072</td>\n", + " <td>7,044,008</td>\n", + " <td>7,158,024</td>\n", + " <td>7,278,717</td>\n", + " </tr>\n", + " <tr>\n", + " <th>3</th>\n", + " <td>Arkansas</td>\n", + " <td>5</td>\n", + " <td>2,921,964</td>\n", + " <td>2,940,667</td>\n", + " <td>2,952,164</td>\n", + " <td>2,959,400</td>\n", + " <td>2,967,392</td>\n", + " <td>2,978,048</td>\n", + " <td>2,989,918</td>\n", + " <td>3,001,345</td>\n", + " <td>3,009,733</td>\n", + " <td>3,017,804</td>\n", + " </tr>\n", + " <tr>\n", + " <th>4</th>\n", + " <td>California</td>\n", + " <td>6</td>\n", + " <td>37,319,502</td>\n", + " <td>37,638,369</td>\n", + " <td>37,948,800</td>\n", + " <td>38,260,787</td>\n", + " <td>38,596,972</td>\n", + " <td>38,918,045</td>\n", + " <td>39,167,117</td>\n", + " <td>39,358,497</td>\n", + " <td>39,461,588</td>\n", + " <td>39,512,223</td>\n", + " </tr>\n", + " <tr>\n", + " <th>5</th>\n", + " <td>Colorado</td>\n", + " <td>8</td>\n", + " <td>5,047,349</td>\n", + " <td>5,121,108</td>\n", + " <td>5,192,647</td>\n", + " <td>5,269,035</td>\n", + " <td>5,350,101</td>\n", + " <td>5,450,623</td>\n", + " <td>5,539,215</td>\n", + " <td>5,611,885</td>\n", + " <td>5,691,287</td>\n", + " <td>5,758,736</td>\n", + " </tr>\n", + " <tr>\n", + " <th>6</th>\n", + " <td>Connecticut</td>\n", + " <td>9</td>\n", + " <td>3,579,114</td>\n", + " <td>3,588,283</td>\n", + " <td>3,594,547</td>\n", + " <td>3,594,841</td>\n", + " <td>3,594,524</td>\n", + " <td>3,587,122</td>\n", + " <td>3,578,141</td>\n", + " <td>3,573,297</td>\n", + " <td>3,571,520</td>\n", + " <td>3,565,287</td>\n", + " </tr>\n", + " <tr>\n", + " <th>7</th>\n", + " <td>Delaware</td>\n", + " <td>10</td>\n", + " <td>899,593</td>\n", + " <td>907,381</td>\n", + " <td>915,179</td>\n", + " <td>923,576</td>\n", + " <td>932,487</td>\n", + " <td>941,252</td>\n", + " <td>948,921</td>\n", + " <td>956,823</td>\n", + " <td>965,479</td>\n", + " <td>973,764</td>\n", + " </tr>\n", + " <tr>\n", + " <th>8</th>\n", + " <td>District of Columbia</td>\n", + " <td>11</td>\n", + " <td>605,226</td>\n", + " <td>619,800</td>\n", + " <td>634,924</td>\n", + " <td>650,581</td>\n", + " <td>662,328</td>\n", + " <td>675,400</td>\n", + " <td>685,815</td>\n", + " <td>694,906</td>\n", + " <td>701,547</td>\n", + " <td>705,749</td>\n", + " </tr>\n", + " <tr>\n", + " <th>9</th>\n", + " <td>Florida</td>\n", + " <td>12</td>\n", + " <td>18,845,537</td>\n", + " <td>19,053,237</td>\n", + " <td>19,297,822</td>\n", + " <td>19,545,621</td>\n", + " <td>19,845,911</td>\n", + " <td>20,209,042</td>\n", + " <td>20,613,477</td>\n", + " <td>20,963,613</td>\n", + " <td>21,244,317</td>\n", + " <td>21,477,737</td>\n", + " </tr>\n", + " <tr>\n", + " <th>10</th>\n", + " <td>Georgia</td>\n", + " <td>13</td>\n", + " <td>9,711,881</td>\n", + " <td>9,802,431</td>\n", + " <td>9,901,430</td>\n", + " <td>9,972,479</td>\n", + " <td>10,067,278</td>\n", + " <td>10,178,447</td>\n", + " <td>10,301,890</td>\n", + " <td>10,410,330</td>\n", + " <td>10,511,131</td>\n", + " <td>10,617,423</td>\n", + " </tr>\n", + " <tr>\n", + " <th>11</th>\n", + " <td>Hawaii</td>\n", + " <td>15</td>\n", + " <td>1,363,963</td>\n", + " <td>1,379,329</td>\n", + " <td>1,394,804</td>\n", + " <td>1,408,243</td>\n", + " <td>1,414,538</td>\n", + " <td>1,422,052</td>\n", + " <td>1,427,559</td>\n", + " <td>1,424,393</td>\n", + " <td>1,420,593</td>\n", + " <td>1,415,872</td>\n", + " </tr>\n", + " <tr>\n", + " <th>12</th>\n", + " <td>Idaho</td>\n", + " <td>16</td>\n", + " <td>1,570,746</td>\n", + " <td>1,583,910</td>\n", + " <td>1,595,324</td>\n", + " <td>1,611,206</td>\n", + " <td>1,631,112</td>\n", + " <td>1,651,059</td>\n", + " <td>1,682,380</td>\n", + " <td>1,717,715</td>\n", + " <td>1,750,536</td>\n", + " <td>1,787,065</td>\n", + " </tr>\n", + " <tr>\n", + " <th>13</th>\n", + " <td>Illinois</td>\n", + " <td>17</td>\n", + " <td>12,840,503</td>\n", + " <td>12,867,454</td>\n", + " <td>12,882,510</td>\n", + " <td>12,895,129</td>\n", + " <td>12,884,493</td>\n", + " <td>12,858,913</td>\n", + " <td>12,820,527</td>\n", + " <td>12,778,828</td>\n", + " <td>12,723,071</td>\n", + " <td>12,671,821</td>\n", + " </tr>\n", + " <tr>\n", + " <th>14</th>\n", + " <td>Indiana</td>\n", + " <td>18</td>\n", + " <td>6,490,432</td>\n", + " <td>6,516,528</td>\n", + " <td>6,537,703</td>\n", + " <td>6,568,713</td>\n", + " <td>6,593,644</td>\n", + " <td>6,608,422</td>\n", + " <td>6,634,304</td>\n", + " <td>6,658,078</td>\n", + " <td>6,695,497</td>\n", + " <td>6,732,219</td>\n", + " </tr>\n", + " <tr>\n", + " <th>15</th>\n", + " <td>Iowa</td>\n", + " <td>19</td>\n", + " <td>3,050,745</td>\n", + " <td>3,066,336</td>\n", + " <td>3,076,190</td>\n", + " <td>3,092,997</td>\n", + " <td>3,109,350</td>\n", + " <td>3,120,960</td>\n", + " <td>3,131,371</td>\n", + " <td>3,141,550</td>\n", + " <td>3,148,618</td>\n", + " <td>3,155,070</td>\n", + " </tr>\n", + " <tr>\n", + " <th>16</th>\n", + " <td>Kansas</td>\n", + " <td>20</td>\n", + " <td>2,858,190</td>\n", + " <td>2,869,225</td>\n", + " <td>2,885,257</td>\n", + " <td>2,893,212</td>\n", + " <td>2,900,475</td>\n", + " <td>2,909,011</td>\n", + " <td>2,910,844</td>\n", + " <td>2,908,718</td>\n", + " <td>2,911,359</td>\n", + " <td>2,913,314</td>\n", + " </tr>\n", + " <tr>\n", + " <th>17</th>\n", + " <td>Kentucky</td>\n", + " <td>21</td>\n", + " <td>4,348,181</td>\n", + " <td>4,369,821</td>\n", + " <td>4,386,346</td>\n", + " <td>4,404,659</td>\n", + " <td>4,414,349</td>\n", + " <td>4,425,976</td>\n", + " <td>4,438,182</td>\n", + " <td>4,452,268</td>\n", + " <td>4,461,153</td>\n", + " <td>4,467,673</td>\n", + " </tr>\n", + " <tr>\n", + " <th>18</th>\n", + " <td>Louisiana</td>\n", + " <td>22</td>\n", + " <td>4,544,532</td>\n", + " <td>4,575,625</td>\n", + " <td>4,600,972</td>\n", + " <td>4,624,527</td>\n", + " <td>4,644,013</td>\n", + " <td>4,664,628</td>\n", + " <td>4,678,135</td>\n", + " <td>4,670,560</td>\n", + " <td>4,659,690</td>\n", + " <td>4,648,794</td>\n", + " </tr>\n", + " <tr>\n", + " <th>19</th>\n", + " <td>Maine</td>\n", + " <td>23</td>\n", + " <td>1,327,629</td>\n", + " <td>1,328,284</td>\n", + " <td>1,327,729</td>\n", + " <td>1,328,009</td>\n", + " <td>1,330,513</td>\n", + " <td>1,328,262</td>\n", + " <td>1,331,317</td>\n", + " <td>1,334,612</td>\n", + " <td>1,339,057</td>\n", + " <td>1,344,212</td>\n", + " </tr>\n", + " <tr>\n", + " <th>20</th>\n", + " <td>Maryland</td>\n", + " <td>24</td>\n", + " <td>5,788,645</td>\n", + " <td>5,839,419</td>\n", + " <td>5,886,992</td>\n", + " <td>5,923,188</td>\n", + " <td>5,957,283</td>\n", + " <td>5,985,562</td>\n", + " <td>6,003,323</td>\n", + " <td>6,023,868</td>\n", + " <td>6,035,802</td>\n", + " <td>6,045,680</td>\n", + " </tr>\n", + " <tr>\n", + " <th>21</th>\n", + " <td>Massachusetts</td>\n", + " <td>25</td>\n", + " <td>6,566,307</td>\n", + " <td>6,613,583</td>\n", + " <td>6,663,005</td>\n", + " <td>6,713,315</td>\n", + " <td>6,762,596</td>\n", + " <td>6,794,228</td>\n", + " <td>6,823,608</td>\n", + " <td>6,859,789</td>\n", + " <td>6,882,635</td>\n", + " <td>6,892,503</td>\n", + " </tr>\n", + " <tr>\n", + " <th>22</th>\n", + " <td>Michigan</td>\n", + " <td>26</td>\n", + " <td>9,877,510</td>\n", + " <td>9,882,412</td>\n", + " <td>9,897,145</td>\n", + " <td>9,913,065</td>\n", + " <td>9,929,848</td>\n", + " <td>9,931,715</td>\n", + " <td>9,950,571</td>\n", + " <td>9,973,114</td>\n", + " <td>9,984,072</td>\n", + " <td>9,986,857</td>\n", + " </tr>\n", + " <tr>\n", + " <th>23</th>\n", + " <td>Minnesota</td>\n", + " <td>27</td>\n", + " <td>5,310,828</td>\n", + " <td>5,346,143</td>\n", + " <td>5,376,643</td>\n", + " <td>5,413,479</td>\n", + " <td>5,451,079</td>\n", + " <td>5,482,032</td>\n", + " <td>5,522,744</td>\n", + " <td>5,566,230</td>\n", + " <td>5,606,249</td>\n", + " <td>5,639,632</td>\n", + " </tr>\n", + " <tr>\n", + " <th>24</th>\n", + " <td>Mississippi</td>\n", + " <td>28</td>\n", + " <td>2,970,548</td>\n", + " <td>2,978,731</td>\n", + " <td>2,983,816</td>\n", + " <td>2,988,711</td>\n", + " <td>2,990,468</td>\n", + " <td>2,988,471</td>\n", + " <td>2,987,938</td>\n", + " <td>2,988,510</td>\n", + " <td>2,981,020</td>\n", + " <td>2,976,149</td>\n", + " </tr>\n", + " <tr>\n", + " <th>25</th>\n", + " <td>Missouri</td>\n", + " <td>29</td>\n", + " <td>5,995,974</td>\n", + " <td>6,010,275</td>\n", + " <td>6,024,367</td>\n", + " <td>6,040,715</td>\n", + " <td>6,056,202</td>\n", + " <td>6,071,732</td>\n", + " <td>6,087,135</td>\n", + " <td>6,106,670</td>\n", + " <td>6,121,623</td>\n", + " <td>6,137,428</td>\n", + " </tr>\n", + " <tr>\n", + " <th>26</th>\n", + " <td>Montana</td>\n", + " <td>30</td>\n", + " <td>990,697</td>\n", + " <td>997,316</td>\n", + " <td>1,003,783</td>\n", + " <td>1,013,569</td>\n", + " <td>1,021,869</td>\n", + " <td>1,030,475</td>\n", + " <td>1,040,859</td>\n", + " <td>1,052,482</td>\n", + " <td>1,060,665</td>\n", + " <td>1,068,778</td>\n", + " </tr>\n", + " <tr>\n", + " <th>27</th>\n", + " <td>Nebraska</td>\n", + " <td>31</td>\n", + " <td>1,829,542</td>\n", + " <td>1,840,672</td>\n", + " <td>1,853,303</td>\n", + " <td>1,865,279</td>\n", + " <td>1,879,321</td>\n", + " <td>1,891,277</td>\n", + " <td>1,905,616</td>\n", + " <td>1,915,947</td>\n", + " <td>1,925,614</td>\n", + " <td>1,934,408</td>\n", + " </tr>\n", + " <tr>\n", + " <th>28</th>\n", + " <td>Nevada</td>\n", + " <td>32</td>\n", + " <td>2,702,405</td>\n", + " <td>2,712,730</td>\n", + " <td>2,743,996</td>\n", + " <td>2,775,970</td>\n", + " <td>2,817,628</td>\n", + " <td>2,866,939</td>\n", + " <td>2,917,563</td>\n", + " <td>2,969,905</td>\n", + " <td>3,027,341</td>\n", + " <td>3,080,156</td>\n", + " </tr>\n", + " <tr>\n", + " <th>29</th>\n", + " <td>New Hampshire</td>\n", + " <td>33</td>\n", + " <td>1,316,762</td>\n", + " <td>1,320,202</td>\n", + " <td>1,324,232</td>\n", + " <td>1,326,622</td>\n", + " <td>1,333,341</td>\n", + " <td>1,336,350</td>\n", + " <td>1,342,307</td>\n", + " <td>1,348,787</td>\n", + " <td>1,353,465</td>\n", + " <td>1,359,711</td>\n", + " </tr>\n", + " <tr>\n", + " <th>30</th>\n", + " <td>New Jersey</td>\n", + " <td>34</td>\n", + " <td>8,799,446</td>\n", + " <td>8,828,117</td>\n", + " <td>8,844,942</td>\n", + " <td>8,856,972</td>\n", + " <td>8,864,525</td>\n", + " <td>8,867,949</td>\n", + " <td>8,870,827</td>\n", + " <td>8,885,525</td>\n", + " <td>8,886,025</td>\n", + " <td>8,882,190</td>\n", + " </tr>\n", + " <tr>\n", + " <th>31</th>\n", + " <td>New Mexico</td>\n", + " <td>35</td>\n", + " <td>2,064,552</td>\n", + " <td>2,080,450</td>\n", + " <td>2,087,309</td>\n", + " <td>2,092,273</td>\n", + " <td>2,089,568</td>\n", + " <td>2,089,291</td>\n", + " <td>2,091,630</td>\n", + " <td>2,091,784</td>\n", + " <td>2,092,741</td>\n", + " <td>2,096,829</td>\n", + " </tr>\n", + " <tr>\n", + " <th>32</th>\n", + " <td>New York</td>\n", + " <td>36</td>\n", + " <td>19,399,878</td>\n", + " <td>19,499,241</td>\n", + " <td>19,572,932</td>\n", + " <td>19,624,447</td>\n", + " <td>19,651,049</td>\n", + " <td>19,654,666</td>\n", + " <td>19,633,428</td>\n", + " <td>19,589,572</td>\n", + " <td>19,530,351</td>\n", + " <td>19,453,561</td>\n", + " </tr>\n", + " <tr>\n", + " <th>33</th>\n", + " <td>North Carolina</td>\n", + " <td>37</td>\n", + " <td>9,574,323</td>\n", + " <td>9,657,592</td>\n", + " <td>9,749,476</td>\n", + " <td>9,843,336</td>\n", + " <td>9,932,887</td>\n", + " <td>10,031,646</td>\n", + " <td>10,154,788</td>\n", + " <td>10,268,233</td>\n", + " <td>10,381,615</td>\n", + " <td>10,488,084</td>\n", + " </tr>\n", + " <tr>\n", + " <th>34</th>\n", + " <td>North Dakota</td>\n", + " <td>38</td>\n", + " <td>674,715</td>\n", + " <td>685,225</td>\n", + " <td>701,176</td>\n", + " <td>722,036</td>\n", + " <td>737,401</td>\n", + " <td>754,066</td>\n", + " <td>754,434</td>\n", + " <td>754,942</td>\n", + " <td>758,080</td>\n", + " <td>762,062</td>\n", + " </tr>\n", + " <tr>\n", + " <th>35</th>\n", + " <td>Ohio</td>\n", + " <td>39</td>\n", + " <td>11,539,336</td>\n", + " <td>11,544,663</td>\n", + " <td>11,548,923</td>\n", + " <td>11,576,684</td>\n", + " <td>11,602,700</td>\n", + " <td>11,617,527</td>\n", + " <td>11,634,370</td>\n", + " <td>11,659,650</td>\n", + " <td>11,676,341</td>\n", + " <td>11,689,100</td>\n", + " </tr>\n", + " <tr>\n", + " <th>36</th>\n", + " <td>Oklahoma</td>\n", + " <td>40</td>\n", + " <td>3,759,944</td>\n", + " <td>3,788,379</td>\n", + " <td>3,818,814</td>\n", + " <td>3,853,214</td>\n", + " <td>3,878,187</td>\n", + " <td>3,909,500</td>\n", + " <td>3,926,331</td>\n", + " <td>3,931,316</td>\n", + " <td>3,940,235</td>\n", + " <td>3,956,971</td>\n", + " </tr>\n", + " <tr>\n", + " <th>37</th>\n", + " <td>Oregon</td>\n", + " <td>41</td>\n", + " <td>3,837,491</td>\n", + " <td>3,872,036</td>\n", + " <td>3,899,001</td>\n", + " <td>3,922,468</td>\n", + " <td>3,963,244</td>\n", + " <td>4,015,792</td>\n", + " <td>4,089,976</td>\n", + " <td>4,143,625</td>\n", + " <td>4,181,886</td>\n", + " <td>4,217,737</td>\n", + " </tr>\n", + " <tr>\n", + " <th>38</th>\n", + " <td>Pennsylvania</td>\n", + " <td>42</td>\n", + " <td>12,711,160</td>\n", + " <td>12,745,815</td>\n", + " <td>12,767,118</td>\n", + " <td>12,776,309</td>\n", + " <td>12,788,313</td>\n", + " <td>12,784,826</td>\n", + " <td>12,782,275</td>\n", + " <td>12,787,641</td>\n", + " <td>12,800,922</td>\n", + " <td>12,801,989</td>\n", + " </tr>\n", + " <tr>\n", + " <th>39</th>\n", + " <td>Rhode Island</td>\n", + " <td>44</td>\n", + " <td>1,053,959</td>\n", + " <td>1,053,649</td>\n", + " <td>1,054,621</td>\n", + " <td>1,055,081</td>\n", + " <td>1,055,936</td>\n", + " <td>1,056,065</td>\n", + " <td>1,056,770</td>\n", + " <td>1,055,673</td>\n", + " <td>1,058,287</td>\n", + " <td>1,059,361</td>\n", + " </tr>\n", + " <tr>\n", + " <th>40</th>\n", + " <td>South Carolina</td>\n", + " <td>45</td>\n", + " <td>4,635,649</td>\n", + " <td>4,671,994</td>\n", + " <td>4,717,354</td>\n", + " <td>4,764,080</td>\n", + " <td>4,823,617</td>\n", + " <td>4,891,938</td>\n", + " <td>4,957,968</td>\n", + " <td>5,021,268</td>\n", + " <td>5,084,156</td>\n", + " <td>5,148,714</td>\n", + " </tr>\n", + " <tr>\n", + " <th>41</th>\n", + " <td>South Dakota</td>\n", + " <td>46</td>\n", + " <td>816,166</td>\n", + " <td>823,579</td>\n", + " <td>833,566</td>\n", + " <td>842,316</td>\n", + " <td>849,129</td>\n", + " <td>853,988</td>\n", + " <td>862,996</td>\n", + " <td>872,868</td>\n", + " <td>878,698</td>\n", + " <td>884,659</td>\n", + " </tr>\n", + " <tr>\n", + " <th>42</th>\n", + " <td>Tennessee</td>\n", + " <td>47</td>\n", + " <td>6,355,311</td>\n", + " <td>6,399,291</td>\n", + " <td>6,453,898</td>\n", + " <td>6,494,340</td>\n", + " <td>6,541,223</td>\n", + " <td>6,591,170</td>\n", + " <td>6,646,010</td>\n", + " <td>6,708,799</td>\n", + " <td>6,771,631</td>\n", + " <td>6,829,174</td>\n", + " </tr>\n", + " <tr>\n", + " <th>43</th>\n", + " <td>Texas</td>\n", + " <td>48</td>\n", + " <td>25,241,971</td>\n", + " <td>25,645,629</td>\n", + " <td>26,084,481</td>\n", + " <td>26,480,266</td>\n", + " <td>26,964,333</td>\n", + " <td>27,470,056</td>\n", + " <td>27,914,410</td>\n", + " <td>28,295,273</td>\n", + " <td>28,628,666</td>\n", + " <td>28,995,881</td>\n", + " </tr>\n", + " <tr>\n", + " <th>44</th>\n", + " <td>Utah</td>\n", + " <td>49</td>\n", + " <td>2,775,332</td>\n", + " <td>2,814,384</td>\n", + " <td>2,853,375</td>\n", + " <td>2,897,640</td>\n", + " <td>2,936,879</td>\n", + " <td>2,981,835</td>\n", + " <td>3,041,868</td>\n", + " <td>3,101,042</td>\n", + " <td>3,153,550</td>\n", + " <td>3,205,958</td>\n", + " </tr>\n", + " <tr>\n", + " <th>45</th>\n", + " <td>Vermont</td>\n", + " <td>50</td>\n", + " <td>625,879</td>\n", + " <td>627,049</td>\n", + " <td>626,090</td>\n", + " <td>626,210</td>\n", + " <td>625,214</td>\n", + " <td>625,216</td>\n", + " <td>623,657</td>\n", + " <td>624,344</td>\n", + " <td>624,358</td>\n", + " <td>623,989</td>\n", + " </tr>\n", + " <tr>\n", + " <th>46</th>\n", + " <td>Virginia</td>\n", + " <td>51</td>\n", + " <td>8,023,699</td>\n", + " <td>8,101,155</td>\n", + " <td>8,185,080</td>\n", + " <td>8,252,427</td>\n", + " <td>8,310,993</td>\n", + " <td>8,361,808</td>\n", + " <td>8,410,106</td>\n", + " <td>8,463,587</td>\n", + " <td>8,501,286</td>\n", + " <td>8,535,519</td>\n", + " </tr>\n", + " <tr>\n", + " <th>47</th>\n", + " <td>Washington</td>\n", + " <td>53</td>\n", + " <td>6,742,830</td>\n", + " <td>6,826,627</td>\n", + " <td>6,897,058</td>\n", + " <td>6,963,985</td>\n", + " <td>7,054,655</td>\n", + " <td>7,163,657</td>\n", + " <td>7,294,771</td>\n", + " <td>7,423,362</td>\n", + " <td>7,523,869</td>\n", + " <td>7,614,893</td>\n", + " </tr>\n", + " <tr>\n", + " <th>48</th>\n", + " <td>West Virginia</td>\n", + " <td>54</td>\n", + " <td>1,854,239</td>\n", + " <td>1,856,301</td>\n", + " <td>1,856,872</td>\n", + " <td>1,853,914</td>\n", + " <td>1,849,489</td>\n", + " <td>1,842,050</td>\n", + " <td>1,831,023</td>\n", + " <td>1,817,004</td>\n", + " <td>1,804,291</td>\n", + " <td>1,792,147</td>\n", + " </tr>\n", + " <tr>\n", + " <th>49</th>\n", + " <td>Wisconsin</td>\n", + " <td>55</td>\n", + " <td>5,690,475</td>\n", + " <td>5,705,288</td>\n", + " <td>5,719,960</td>\n", + " <td>5,736,754</td>\n", + " <td>5,751,525</td>\n", + " <td>5,760,940</td>\n", + " <td>5,772,628</td>\n", + " <td>5,790,186</td>\n", + " <td>5,807,406</td>\n", + " <td>5,822,434</td>\n", + " </tr>\n", + " <tr>\n", + " <th>50</th>\n", + " <td>Wyoming</td>\n", + " <td>56</td>\n", + " <td>564,487</td>\n", + " <td>567,299</td>\n", + " <td>576,305</td>\n", + " <td>582,122</td>\n", + " <td>582,531</td>\n", + " <td>585,613</td>\n", + " <td>584,215</td>\n", + " <td>578,931</td>\n", + " <td>577,601</td>\n", + " <td>578,759</td>\n", + " </tr>\n", + " <tr>\n", + " <th>51</th>\n", + " <td>Puerto Rico</td>\n", + " <td>72</td>\n", + " <td>3,721,525</td>\n", + " <td>3,678,732</td>\n", + " <td>3,634,488</td>\n", + " <td>3,593,077</td>\n", + " <td>3,534,874</td>\n", + " <td>3,473,232</td>\n", + " <td>3,406,672</td>\n", + " <td>3,325,286</td>\n", + " <td>3,193,354</td>\n", + " <td>3,193,694</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>\n", + " <div class=\"colab-df-buttons\">\n", + "\n", + " <div class=\"colab-df-container\">\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-3cb8d892-d5a2-4e9b-a6f6-1037200435f1')\"\n", + " title=\"Convert this dataframe to an interactive table.\"\n", + " style=\"display:none;\">\n", + "\n", + " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", + " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", + " </svg>\n", + " </button>\n", + "\n", + " <style>\n", + " .colab-df-container {\n", + " display:flex;\n", + " gap: 12px;\n", + " }\n", + "\n", + " .colab-df-convert {\n", + " background-color: #E8F0FE;\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: #1967D2;\n", + " height: 32px;\n", + " padding: 0 0 0 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-convert:hover {\n", + " background-color: #E2EBFA;\n", + " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: #174EA6;\n", + " }\n", + "\n", + " .colab-df-buttons div {\n", + " margin-bottom: 4px;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert {\n", + " background-color: #3B4455;\n", + " fill: #D2E3FC;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert:hover {\n", + " background-color: #434B5C;\n", + " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", + " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", + " fill: #FFFFFF;\n", + " }\n", + " </style>\n", + "\n", + " <script>\n", + " const buttonEl =\n", + " document.querySelector('#df-3cb8d892-d5a2-4e9b-a6f6-1037200435f1 button.colab-df-convert');\n", + " buttonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + "\n", + " async function convertToInteractive(key) {\n", + " const element = document.querySelector('#df-3cb8d892-d5a2-4e9b-a6f6-1037200435f1');\n", + " const dataTable =\n", + " await google.colab.kernel.invokeFunction('convertToInteractive',\n", + " [key], {});\n", + " if (!dataTable) return;\n", + "\n", + " const docLinkHtml = 'Like what you see? Visit the ' +\n", + " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", + " + ' to learn more about interactive tables.';\n", + " element.innerHTML = '';\n", + " dataTable['output_type'] = 'display_data';\n", + " await google.colab.output.renderOutput(dataTable, element);\n", + " const docLink = document.createElement('div');\n", + " docLink.innerHTML = docLinkHtml;\n", + " element.appendChild(docLink);\n", + " }\n", + " </script>\n", + " </div>\n", + "\n", + "\n", + "<div id=\"df-be77509e-bea0-4423-8d61-182c4873ef61\">\n", + " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-be77509e-bea0-4423-8d61-182c4873ef61')\"\n", + " title=\"Suggest charts\"\n", + " style=\"display:none;\">\n", + "\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", + " width=\"24px\">\n", + " <g>\n", + " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", + " </g>\n", + "</svg>\n", + " </button>\n", + "\n", + "<style>\n", + " .colab-df-quickchart {\n", + " --bg-color: #E8F0FE;\n", + " --fill-color: #1967D2;\n", + " --hover-bg-color: #E2EBFA;\n", + " --hover-fill-color: #174EA6;\n", + " --disabled-fill-color: #AAA;\n", + " --disabled-bg-color: #DDD;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-quickchart {\n", + " --bg-color: #3B4455;\n", + " --fill-color: #D2E3FC;\n", + " --hover-bg-color: #434B5C;\n", + " --hover-fill-color: #FFFFFF;\n", + " --disabled-bg-color: #3B4455;\n", + " --disabled-fill-color: #666;\n", + " }\n", + "\n", + " .colab-df-quickchart {\n", + " background-color: var(--bg-color);\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: var(--fill-color);\n", + " height: 32px;\n", + " padding: 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-quickchart:hover {\n", + " background-color: var(--hover-bg-color);\n", + " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: var(--button-hover-fill-color);\n", + " }\n", + "\n", + " .colab-df-quickchart-complete:disabled,\n", + " .colab-df-quickchart-complete:disabled:hover {\n", + " background-color: var(--disabled-bg-color);\n", + " fill: var(--disabled-fill-color);\n", + " box-shadow: none;\n", + " }\n", + "\n", + " .colab-df-spinner {\n", + " border: 2px solid var(--fill-color);\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " animation:\n", + " spin 1s steps(1) infinite;\n", + " }\n", + "\n", + " @keyframes spin {\n", + " 0% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " border-left-color: var(--fill-color);\n", + " }\n", + " 20% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 30% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 40% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 60% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 80% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " 90% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " }\n", + "</style>\n", + "\n", + " <script>\n", + " async function quickchart(key) {\n", + " const quickchartButtonEl =\n", + " document.querySelector('#' + key + ' button');\n", + " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", + " quickchartButtonEl.classList.add('colab-df-spinner');\n", + " try {\n", + " const charts = await google.colab.kernel.invokeFunction(\n", + " 'suggestCharts', [key], {});\n", + " } catch (error) {\n", + " console.error('Error during call to suggestCharts:', error);\n", + " }\n", + " quickchartButtonEl.classList.remove('colab-df-spinner');\n", + " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", + " }\n", + " (() => {\n", + " let quickchartButtonEl =\n", + " document.querySelector('#df-be77509e-bea0-4423-8d61-182c4873ef61 button');\n", + " quickchartButtonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + " })();\n", + " </script>\n", + "</div>\n", + " </div>\n", + " </div>\n" + ] + }, + "metadata": {}, + "execution_count": 1 + } + ] + }, + { + "cell_type": "code", + "source": [ + "states_abbreviation = {\n", + " \"Alabama\": \"AL\",\n", + " \"Alaska\": \"AK\",\n", + " \"Arizona\": \"AZ\",\n", + " \"Arkansas\": \"AR\",\n", + " \"California\": \"CA\",\n", + " \"Colorado\": \"CO\",\n", + " \"Connecticut\": \"CT\",\n", + " \"Delaware\": \"DE\",\n", + " \"Florida\": \"FL\",\n", + " \"Georgia\": \"GA\",\n", + " \"Hawaii\": \"HI\",\n", + " \"Idaho\": \"ID\",\n", + " \"Illinois\": \"IL\",\n", + " \"Indiana\": \"IN\",\n", + " \"Iowa\": \"IA\",\n", + " \"Kansas\": \"KS\",\n", + " \"Kentucky\": \"KY\",\n", + " \"Louisiana\": \"LA\",\n", + " \"Maine\": \"ME\",\n", + " \"Maryland\": \"MD\",\n", + " \"Massachusetts\": \"MA\",\n", + " \"Michigan\": \"MI\",\n", + " \"Minnesota\": \"MN\",\n", + " \"Mississippi\": \"MS\",\n", + " \"Missouri\": \"MO\",\n", + " \"Montana\": \"MT\",\n", + " \"Nebraska\": \"NE\",\n", + " \"Nevada\": \"NV\",\n", + " \"New Hampshire\": \"NH\",\n", + " \"New Jersey\": \"NJ\",\n", + " \"New Mexico\": \"NM\",\n", + " \"New York\": \"NY\",\n", + " \"North Carolina\": \"NC\",\n", + " \"North Dakota\": \"ND\",\n", + " \"Ohio\": \"OH\",\n", + " \"Oklahoma\": \"OK\",\n", + " \"Oregon\": \"OR\",\n", + " \"Pennsylvania\": \"PA\",\n", + " \"Rhode Island\": \"RI\",\n", + " \"South Carolina\": \"SC\",\n", + " \"South Dakota\": \"SD\",\n", + " \"Tennessee\": \"TN\",\n", + " \"Texas\": \"TX\",\n", + " \"Utah\": \"UT\",\n", + " \"Vermont\": \"VT\",\n", + " \"Virginia\": \"VA\",\n", + " \"Washington\": \"WA\",\n", + " \"West Virginia\": \"WV\",\n", + " \"Wisconsin\": \"WI\",\n", + " \"Wyoming\": \"WY\",\n", + " \"District of Columbia\": \"DC\",\n", + " \"American Samoa\": \"AS\",\n", + " \"Guam\": \"GU\",\n", + " \"Northern Mariana Islands\": \"MP\",\n", + " \"Puerto Rico\": \"PR\",\n", + " \"United States Minor Outlying Islands\": \"UM\",\n", + " \"U.S. Virgin Islands\": \"VI\",\n", + "}\n", + "\n", + "# invert the dictionary\n", + "# abbrev_to_us_state = dict(map(reversed, us_state_to_abbrev.items()))\n", + "\n", + "df['states_code'] = [states_abbreviation[x] for x in df.states]\n", + "df" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "sbZVifOso9jh", + "outputId": "8397f076-7893-4af4-cc5d-747981b59f05" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " states id 2010 2011 2012 2013 \\\n", + "0 Alabama 1 4,785,437 4,799,069 4,815,588 4,830,081 \n", + "1 Alaska 2 713,910 722,128 730,443 737,068 \n", + "2 Arizona 4 6,407,172 6,472,643 6,554,978 6,632,764 \n", + "3 Arkansas 5 2,921,964 2,940,667 2,952,164 2,959,400 \n", + "4 California 6 37,319,502 37,638,369 37,948,800 38,260,787 \n", + "5 Colorado 8 5,047,349 5,121,108 5,192,647 5,269,035 \n", + "6 Connecticut 9 3,579,114 3,588,283 3,594,547 3,594,841 \n", + "7 Delaware 10 899,593 907,381 915,179 923,576 \n", + "8 District of Columbia 11 605,226 619,800 634,924 650,581 \n", + "9 Florida 12 18,845,537 19,053,237 19,297,822 19,545,621 \n", + "10 Georgia 13 9,711,881 9,802,431 9,901,430 9,972,479 \n", + "11 Hawaii 15 1,363,963 1,379,329 1,394,804 1,408,243 \n", + "12 Idaho 16 1,570,746 1,583,910 1,595,324 1,611,206 \n", + "13 Illinois 17 12,840,503 12,867,454 12,882,510 12,895,129 \n", + "14 Indiana 18 6,490,432 6,516,528 6,537,703 6,568,713 \n", + "15 Iowa 19 3,050,745 3,066,336 3,076,190 3,092,997 \n", + "16 Kansas 20 2,858,190 2,869,225 2,885,257 2,893,212 \n", + "17 Kentucky 21 4,348,181 4,369,821 4,386,346 4,404,659 \n", + "18 Louisiana 22 4,544,532 4,575,625 4,600,972 4,624,527 \n", + "19 Maine 23 1,327,629 1,328,284 1,327,729 1,328,009 \n", + "20 Maryland 24 5,788,645 5,839,419 5,886,992 5,923,188 \n", + "21 Massachusetts 25 6,566,307 6,613,583 6,663,005 6,713,315 \n", + "22 Michigan 26 9,877,510 9,882,412 9,897,145 9,913,065 \n", + "23 Minnesota 27 5,310,828 5,346,143 5,376,643 5,413,479 \n", + "24 Mississippi 28 2,970,548 2,978,731 2,983,816 2,988,711 \n", + "25 Missouri 29 5,995,974 6,010,275 6,024,367 6,040,715 \n", + "26 Montana 30 990,697 997,316 1,003,783 1,013,569 \n", + "27 Nebraska 31 1,829,542 1,840,672 1,853,303 1,865,279 \n", + "28 Nevada 32 2,702,405 2,712,730 2,743,996 2,775,970 \n", + "29 New Hampshire 33 1,316,762 1,320,202 1,324,232 1,326,622 \n", + "30 New Jersey 34 8,799,446 8,828,117 8,844,942 8,856,972 \n", + "31 New Mexico 35 2,064,552 2,080,450 2,087,309 2,092,273 \n", + "32 New York 36 19,399,878 19,499,241 19,572,932 19,624,447 \n", + "33 North Carolina 37 9,574,323 9,657,592 9,749,476 9,843,336 \n", + "34 North Dakota 38 674,715 685,225 701,176 722,036 \n", + "35 Ohio 39 11,539,336 11,544,663 11,548,923 11,576,684 \n", + "36 Oklahoma 40 3,759,944 3,788,379 3,818,814 3,853,214 \n", + "37 Oregon 41 3,837,491 3,872,036 3,899,001 3,922,468 \n", + "38 Pennsylvania 42 12,711,160 12,745,815 12,767,118 12,776,309 \n", + "39 Rhode Island 44 1,053,959 1,053,649 1,054,621 1,055,081 \n", + "40 South Carolina 45 4,635,649 4,671,994 4,717,354 4,764,080 \n", + "41 South Dakota 46 816,166 823,579 833,566 842,316 \n", + "42 Tennessee 47 6,355,311 6,399,291 6,453,898 6,494,340 \n", + "43 Texas 48 25,241,971 25,645,629 26,084,481 26,480,266 \n", + "44 Utah 49 2,775,332 2,814,384 2,853,375 2,897,640 \n", + "45 Vermont 50 625,879 627,049 626,090 626,210 \n", + "46 Virginia 51 8,023,699 8,101,155 8,185,080 8,252,427 \n", + "47 Washington 53 6,742,830 6,826,627 6,897,058 6,963,985 \n", + "48 West Virginia 54 1,854,239 1,856,301 1,856,872 1,853,914 \n", + "49 Wisconsin 55 5,690,475 5,705,288 5,719,960 5,736,754 \n", + "50 Wyoming 56 564,487 567,299 576,305 582,122 \n", + "51 Puerto Rico 72 3,721,525 3,678,732 3,634,488 3,593,077 \n", + "\n", + " 2014 2015 2016 2017 2018 2019 \\\n", + "0 4,841,799 4,852,347 4,863,525 4,874,486 4,887,681 4,903,185 \n", + "1 736,283 737,498 741,456 739,700 735,139 731,545 \n", + "2 6,730,413 6,829,676 6,941,072 7,044,008 7,158,024 7,278,717 \n", + "3 2,967,392 2,978,048 2,989,918 3,001,345 3,009,733 3,017,804 \n", + "4 38,596,972 38,918,045 39,167,117 39,358,497 39,461,588 39,512,223 \n", + "5 5,350,101 5,450,623 5,539,215 5,611,885 5,691,287 5,758,736 \n", + "6 3,594,524 3,587,122 3,578,141 3,573,297 3,571,520 3,565,287 \n", + "7 932,487 941,252 948,921 956,823 965,479 973,764 \n", + "8 662,328 675,400 685,815 694,906 701,547 705,749 \n", + "9 19,845,911 20,209,042 20,613,477 20,963,613 21,244,317 21,477,737 \n", + "10 10,067,278 10,178,447 10,301,890 10,410,330 10,511,131 10,617,423 \n", + "11 1,414,538 1,422,052 1,427,559 1,424,393 1,420,593 1,415,872 \n", + "12 1,631,112 1,651,059 1,682,380 1,717,715 1,750,536 1,787,065 \n", + "13 12,884,493 12,858,913 12,820,527 12,778,828 12,723,071 12,671,821 \n", + "14 6,593,644 6,608,422 6,634,304 6,658,078 6,695,497 6,732,219 \n", + "15 3,109,350 3,120,960 3,131,371 3,141,550 3,148,618 3,155,070 \n", + "16 2,900,475 2,909,011 2,910,844 2,908,718 2,911,359 2,913,314 \n", + "17 4,414,349 4,425,976 4,438,182 4,452,268 4,461,153 4,467,673 \n", + "18 4,644,013 4,664,628 4,678,135 4,670,560 4,659,690 4,648,794 \n", + "19 1,330,513 1,328,262 1,331,317 1,334,612 1,339,057 1,344,212 \n", + "20 5,957,283 5,985,562 6,003,323 6,023,868 6,035,802 6,045,680 \n", + "21 6,762,596 6,794,228 6,823,608 6,859,789 6,882,635 6,892,503 \n", + "22 9,929,848 9,931,715 9,950,571 9,973,114 9,984,072 9,986,857 \n", + "23 5,451,079 5,482,032 5,522,744 5,566,230 5,606,249 5,639,632 \n", + "24 2,990,468 2,988,471 2,987,938 2,988,510 2,981,020 2,976,149 \n", + "25 6,056,202 6,071,732 6,087,135 6,106,670 6,121,623 6,137,428 \n", + "26 1,021,869 1,030,475 1,040,859 1,052,482 1,060,665 1,068,778 \n", + "27 1,879,321 1,891,277 1,905,616 1,915,947 1,925,614 1,934,408 \n", + "28 2,817,628 2,866,939 2,917,563 2,969,905 3,027,341 3,080,156 \n", + "29 1,333,341 1,336,350 1,342,307 1,348,787 1,353,465 1,359,711 \n", + "30 8,864,525 8,867,949 8,870,827 8,885,525 8,886,025 8,882,190 \n", + "31 2,089,568 2,089,291 2,091,630 2,091,784 2,092,741 2,096,829 \n", + "32 19,651,049 19,654,666 19,633,428 19,589,572 19,530,351 19,453,561 \n", + "33 9,932,887 10,031,646 10,154,788 10,268,233 10,381,615 10,488,084 \n", + "34 737,401 754,066 754,434 754,942 758,080 762,062 \n", + "35 11,602,700 11,617,527 11,634,370 11,659,650 11,676,341 11,689,100 \n", + "36 3,878,187 3,909,500 3,926,331 3,931,316 3,940,235 3,956,971 \n", + "37 3,963,244 4,015,792 4,089,976 4,143,625 4,181,886 4,217,737 \n", + "38 12,788,313 12,784,826 12,782,275 12,787,641 12,800,922 12,801,989 \n", + "39 1,055,936 1,056,065 1,056,770 1,055,673 1,058,287 1,059,361 \n", + "40 4,823,617 4,891,938 4,957,968 5,021,268 5,084,156 5,148,714 \n", + "41 849,129 853,988 862,996 872,868 878,698 884,659 \n", + "42 6,541,223 6,591,170 6,646,010 6,708,799 6,771,631 6,829,174 \n", + "43 26,964,333 27,470,056 27,914,410 28,295,273 28,628,666 28,995,881 \n", + "44 2,936,879 2,981,835 3,041,868 3,101,042 3,153,550 3,205,958 \n", + "45 625,214 625,216 623,657 624,344 624,358 623,989 \n", + "46 8,310,993 8,361,808 8,410,106 8,463,587 8,501,286 8,535,519 \n", + "47 7,054,655 7,163,657 7,294,771 7,423,362 7,523,869 7,614,893 \n", + "48 1,849,489 1,842,050 1,831,023 1,817,004 1,804,291 1,792,147 \n", + "49 5,751,525 5,760,940 5,772,628 5,790,186 5,807,406 5,822,434 \n", + "50 582,531 585,613 584,215 578,931 577,601 578,759 \n", + "51 3,534,874 3,473,232 3,406,672 3,325,286 3,193,354 3,193,694 \n", + "\n", + " states_code \n", + "0 AL \n", + "1 AK \n", + "2 AZ \n", + "3 AR \n", + "4 CA \n", + "5 CO \n", + "6 CT \n", + "7 DE \n", + "8 DC \n", + "9 FL \n", + "10 GA \n", + "11 HI \n", + "12 ID \n", + "13 IL \n", + "14 IN \n", + "15 IA \n", + "16 KS \n", + "17 KY \n", + "18 LA \n", + "19 ME \n", + "20 MD \n", + "21 MA \n", + "22 MI \n", + "23 MN \n", + "24 MS \n", + "25 MO \n", + "26 MT \n", + "27 NE \n", + "28 NV \n", + "29 NH \n", + "30 NJ \n", + "31 NM \n", + "32 NY \n", + "33 NC \n", + "34 ND \n", + "35 OH \n", + "36 OK \n", + "37 OR \n", + "38 PA \n", + "39 RI \n", + "40 SC \n", + "41 SD \n", + "42 TN \n", + "43 TX \n", + "44 UT \n", + "45 VT \n", + "46 VA \n", + "47 WA \n", + "48 WV \n", + "49 WI \n", + "50 WY \n", + "51 PR " + ], + "text/html": [ + "\n", + " <div id=\"df-6b182c29-32fb-4ce1-bab9-22d74ba4b8f2\" class=\"colab-df-container\">\n", + " <div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>states</th>\n", + " <th>id</th>\n", + " <th>2010</th>\n", + " <th>2011</th>\n", + " <th>2012</th>\n", + " <th>2013</th>\n", + " <th>2014</th>\n", + " <th>2015</th>\n", + " <th>2016</th>\n", + " <th>2017</th>\n", + " <th>2018</th>\n", + " <th>2019</th>\n", + " <th>states_code</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>Alabama</td>\n", + " <td>1</td>\n", + " <td>4,785,437</td>\n", + " <td>4,799,069</td>\n", + " <td>4,815,588</td>\n", + " <td>4,830,081</td>\n", + " <td>4,841,799</td>\n", + " <td>4,852,347</td>\n", + " <td>4,863,525</td>\n", + " <td>4,874,486</td>\n", + " <td>4,887,681</td>\n", + " <td>4,903,185</td>\n", + " <td>AL</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>Alaska</td>\n", + " <td>2</td>\n", + " <td>713,910</td>\n", + " <td>722,128</td>\n", + " <td>730,443</td>\n", + " <td>737,068</td>\n", + " <td>736,283</td>\n", + " <td>737,498</td>\n", + " <td>741,456</td>\n", + " <td>739,700</td>\n", + " <td>735,139</td>\n", + " <td>731,545</td>\n", + " <td>AK</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <td>Arizona</td>\n", + " <td>4</td>\n", + " <td>6,407,172</td>\n", + " <td>6,472,643</td>\n", + " <td>6,554,978</td>\n", + " <td>6,632,764</td>\n", + " <td>6,730,413</td>\n", + " <td>6,829,676</td>\n", + " <td>6,941,072</td>\n", + " <td>7,044,008</td>\n", + " <td>7,158,024</td>\n", + " <td>7,278,717</td>\n", + " <td>AZ</td>\n", + " </tr>\n", + " <tr>\n", + " <th>3</th>\n", + " <td>Arkansas</td>\n", + " <td>5</td>\n", + " <td>2,921,964</td>\n", + " <td>2,940,667</td>\n", + " <td>2,952,164</td>\n", + " <td>2,959,400</td>\n", + " <td>2,967,392</td>\n", + " <td>2,978,048</td>\n", + " <td>2,989,918</td>\n", + " <td>3,001,345</td>\n", + " <td>3,009,733</td>\n", + " <td>3,017,804</td>\n", + " <td>AR</td>\n", + " </tr>\n", + " <tr>\n", + " <th>4</th>\n", + " <td>California</td>\n", + " <td>6</td>\n", + " <td>37,319,502</td>\n", + " <td>37,638,369</td>\n", + " <td>37,948,800</td>\n", + " <td>38,260,787</td>\n", + " <td>38,596,972</td>\n", + " <td>38,918,045</td>\n", + " <td>39,167,117</td>\n", + " <td>39,358,497</td>\n", + " <td>39,461,588</td>\n", + " <td>39,512,223</td>\n", + " <td>CA</td>\n", + " </tr>\n", + " <tr>\n", + " <th>5</th>\n", + " <td>Colorado</td>\n", + " <td>8</td>\n", + " <td>5,047,349</td>\n", + " <td>5,121,108</td>\n", + " <td>5,192,647</td>\n", + " <td>5,269,035</td>\n", + " <td>5,350,101</td>\n", + " <td>5,450,623</td>\n", + " <td>5,539,215</td>\n", + " <td>5,611,885</td>\n", + " <td>5,691,287</td>\n", + " <td>5,758,736</td>\n", + " <td>CO</td>\n", + " </tr>\n", + " <tr>\n", + " <th>6</th>\n", + " <td>Connecticut</td>\n", + " <td>9</td>\n", + " <td>3,579,114</td>\n", + " <td>3,588,283</td>\n", + " <td>3,594,547</td>\n", + " <td>3,594,841</td>\n", + " <td>3,594,524</td>\n", + " <td>3,587,122</td>\n", + " <td>3,578,141</td>\n", + " <td>3,573,297</td>\n", + " <td>3,571,520</td>\n", + " <td>3,565,287</td>\n", + " <td>CT</td>\n", + " </tr>\n", + " <tr>\n", + " <th>7</th>\n", + " <td>Delaware</td>\n", + " <td>10</td>\n", + " <td>899,593</td>\n", + " <td>907,381</td>\n", + " <td>915,179</td>\n", + " <td>923,576</td>\n", + " <td>932,487</td>\n", + " <td>941,252</td>\n", + " <td>948,921</td>\n", + " <td>956,823</td>\n", + " <td>965,479</td>\n", + " <td>973,764</td>\n", + " <td>DE</td>\n", + " </tr>\n", + " <tr>\n", + " <th>8</th>\n", + " <td>District of Columbia</td>\n", + " <td>11</td>\n", + " <td>605,226</td>\n", + " <td>619,800</td>\n", + " <td>634,924</td>\n", + " <td>650,581</td>\n", + " <td>662,328</td>\n", + " <td>675,400</td>\n", + " <td>685,815</td>\n", + " <td>694,906</td>\n", + " <td>701,547</td>\n", + " <td>705,749</td>\n", + " <td>DC</td>\n", + " </tr>\n", + " <tr>\n", + " <th>9</th>\n", + " <td>Florida</td>\n", + " <td>12</td>\n", + " <td>18,845,537</td>\n", + " <td>19,053,237</td>\n", + " <td>19,297,822</td>\n", + " <td>19,545,621</td>\n", + " <td>19,845,911</td>\n", + " <td>20,209,042</td>\n", + " <td>20,613,477</td>\n", + " <td>20,963,613</td>\n", + " <td>21,244,317</td>\n", + " <td>21,477,737</td>\n", + " <td>FL</td>\n", + " </tr>\n", + " <tr>\n", + " <th>10</th>\n", + " <td>Georgia</td>\n", + " <td>13</td>\n", + " <td>9,711,881</td>\n", + " <td>9,802,431</td>\n", + " <td>9,901,430</td>\n", + " <td>9,972,479</td>\n", + " <td>10,067,278</td>\n", + " <td>10,178,447</td>\n", + " <td>10,301,890</td>\n", + " <td>10,410,330</td>\n", + " <td>10,511,131</td>\n", + " <td>10,617,423</td>\n", + " <td>GA</td>\n", + " </tr>\n", + " <tr>\n", + " <th>11</th>\n", + " <td>Hawaii</td>\n", + " <td>15</td>\n", + " <td>1,363,963</td>\n", + " <td>1,379,329</td>\n", + " <td>1,394,804</td>\n", + " <td>1,408,243</td>\n", + " <td>1,414,538</td>\n", + " <td>1,422,052</td>\n", + " <td>1,427,559</td>\n", + " <td>1,424,393</td>\n", + " <td>1,420,593</td>\n", + " <td>1,415,872</td>\n", + " <td>HI</td>\n", + " </tr>\n", + " <tr>\n", + " <th>12</th>\n", + " <td>Idaho</td>\n", + " <td>16</td>\n", + " <td>1,570,746</td>\n", + " <td>1,583,910</td>\n", + " <td>1,595,324</td>\n", + " <td>1,611,206</td>\n", + " <td>1,631,112</td>\n", + " <td>1,651,059</td>\n", + " <td>1,682,380</td>\n", + " <td>1,717,715</td>\n", + " <td>1,750,536</td>\n", + " <td>1,787,065</td>\n", + " <td>ID</td>\n", + " </tr>\n", + " <tr>\n", + " <th>13</th>\n", + " <td>Illinois</td>\n", + " <td>17</td>\n", + " <td>12,840,503</td>\n", + " <td>12,867,454</td>\n", + " <td>12,882,510</td>\n", + " <td>12,895,129</td>\n", + " <td>12,884,493</td>\n", + " <td>12,858,913</td>\n", + " <td>12,820,527</td>\n", + " <td>12,778,828</td>\n", + " <td>12,723,071</td>\n", + " <td>12,671,821</td>\n", + " <td>IL</td>\n", + " </tr>\n", + " <tr>\n", + " <th>14</th>\n", + " <td>Indiana</td>\n", + " <td>18</td>\n", + " <td>6,490,432</td>\n", + " <td>6,516,528</td>\n", + " <td>6,537,703</td>\n", + " <td>6,568,713</td>\n", + " <td>6,593,644</td>\n", + " <td>6,608,422</td>\n", + " <td>6,634,304</td>\n", + " <td>6,658,078</td>\n", + " <td>6,695,497</td>\n", + " <td>6,732,219</td>\n", + " <td>IN</td>\n", + " </tr>\n", + " <tr>\n", + " <th>15</th>\n", + " <td>Iowa</td>\n", + " <td>19</td>\n", + " <td>3,050,745</td>\n", + " <td>3,066,336</td>\n", + " <td>3,076,190</td>\n", + " <td>3,092,997</td>\n", + " <td>3,109,350</td>\n", + " <td>3,120,960</td>\n", + " <td>3,131,371</td>\n", + " <td>3,141,550</td>\n", + " <td>3,148,618</td>\n", + " <td>3,155,070</td>\n", + " <td>IA</td>\n", + " </tr>\n", + " <tr>\n", + " <th>16</th>\n", + " <td>Kansas</td>\n", + " <td>20</td>\n", + " <td>2,858,190</td>\n", + " <td>2,869,225</td>\n", + " <td>2,885,257</td>\n", + " <td>2,893,212</td>\n", + " <td>2,900,475</td>\n", + " <td>2,909,011</td>\n", + " <td>2,910,844</td>\n", + " <td>2,908,718</td>\n", + " <td>2,911,359</td>\n", + " <td>2,913,314</td>\n", + " <td>KS</td>\n", + " </tr>\n", + " <tr>\n", + " <th>17</th>\n", + " <td>Kentucky</td>\n", + " <td>21</td>\n", + " <td>4,348,181</td>\n", + " <td>4,369,821</td>\n", + " <td>4,386,346</td>\n", + " <td>4,404,659</td>\n", + " <td>4,414,349</td>\n", + " <td>4,425,976</td>\n", + " <td>4,438,182</td>\n", + " <td>4,452,268</td>\n", + " <td>4,461,153</td>\n", + " <td>4,467,673</td>\n", + " <td>KY</td>\n", + " </tr>\n", + " <tr>\n", + " <th>18</th>\n", + " <td>Louisiana</td>\n", + " <td>22</td>\n", + " <td>4,544,532</td>\n", + " <td>4,575,625</td>\n", + " <td>4,600,972</td>\n", + " <td>4,624,527</td>\n", + " <td>4,644,013</td>\n", + " <td>4,664,628</td>\n", + " <td>4,678,135</td>\n", + " <td>4,670,560</td>\n", + " <td>4,659,690</td>\n", + " <td>4,648,794</td>\n", + " <td>LA</td>\n", + " </tr>\n", + " <tr>\n", + " <th>19</th>\n", + " <td>Maine</td>\n", + " <td>23</td>\n", + " <td>1,327,629</td>\n", + " <td>1,328,284</td>\n", + " <td>1,327,729</td>\n", + " <td>1,328,009</td>\n", + " <td>1,330,513</td>\n", + " <td>1,328,262</td>\n", + " <td>1,331,317</td>\n", + " <td>1,334,612</td>\n", + " <td>1,339,057</td>\n", + " <td>1,344,212</td>\n", + " <td>ME</td>\n", + " </tr>\n", + " <tr>\n", + " <th>20</th>\n", + " <td>Maryland</td>\n", + " <td>24</td>\n", + " <td>5,788,645</td>\n", + " <td>5,839,419</td>\n", + " <td>5,886,992</td>\n", + " <td>5,923,188</td>\n", + " <td>5,957,283</td>\n", + " <td>5,985,562</td>\n", + " <td>6,003,323</td>\n", + " <td>6,023,868</td>\n", + " <td>6,035,802</td>\n", + " <td>6,045,680</td>\n", + " <td>MD</td>\n", + " </tr>\n", + " <tr>\n", + " <th>21</th>\n", + " <td>Massachusetts</td>\n", + " <td>25</td>\n", + " <td>6,566,307</td>\n", + " <td>6,613,583</td>\n", + " <td>6,663,005</td>\n", + " <td>6,713,315</td>\n", + " <td>6,762,596</td>\n", + " <td>6,794,228</td>\n", + " <td>6,823,608</td>\n", + " <td>6,859,789</td>\n", + " <td>6,882,635</td>\n", + " <td>6,892,503</td>\n", + " <td>MA</td>\n", + " </tr>\n", + " <tr>\n", + " <th>22</th>\n", + " <td>Michigan</td>\n", + " <td>26</td>\n", + " <td>9,877,510</td>\n", + " <td>9,882,412</td>\n", + " <td>9,897,145</td>\n", + " <td>9,913,065</td>\n", + " <td>9,929,848</td>\n", + " <td>9,931,715</td>\n", + " <td>9,950,571</td>\n", + " <td>9,973,114</td>\n", + " <td>9,984,072</td>\n", + " <td>9,986,857</td>\n", + " <td>MI</td>\n", + " </tr>\n", + " <tr>\n", + " <th>23</th>\n", + " <td>Minnesota</td>\n", + " <td>27</td>\n", + " <td>5,310,828</td>\n", + " <td>5,346,143</td>\n", + " <td>5,376,643</td>\n", + " <td>5,413,479</td>\n", + " <td>5,451,079</td>\n", + " <td>5,482,032</td>\n", + " <td>5,522,744</td>\n", + " <td>5,566,230</td>\n", + " <td>5,606,249</td>\n", + " <td>5,639,632</td>\n", + " <td>MN</td>\n", + " </tr>\n", + " <tr>\n", + " <th>24</th>\n", + " <td>Mississippi</td>\n", + " <td>28</td>\n", + " <td>2,970,548</td>\n", + " <td>2,978,731</td>\n", + " <td>2,983,816</td>\n", + " <td>2,988,711</td>\n", + " <td>2,990,468</td>\n", + " <td>2,988,471</td>\n", + " <td>2,987,938</td>\n", + " <td>2,988,510</td>\n", + " <td>2,981,020</td>\n", + " <td>2,976,149</td>\n", + " <td>MS</td>\n", + " </tr>\n", + " <tr>\n", + " <th>25</th>\n", + " <td>Missouri</td>\n", + " <td>29</td>\n", + " <td>5,995,974</td>\n", + " <td>6,010,275</td>\n", + " <td>6,024,367</td>\n", + " <td>6,040,715</td>\n", + " <td>6,056,202</td>\n", + " <td>6,071,732</td>\n", + " <td>6,087,135</td>\n", + " <td>6,106,670</td>\n", + " <td>6,121,623</td>\n", + " <td>6,137,428</td>\n", + " <td>MO</td>\n", + " </tr>\n", + " <tr>\n", + " <th>26</th>\n", + " <td>Montana</td>\n", + " <td>30</td>\n", + " <td>990,697</td>\n", + " <td>997,316</td>\n", + " <td>1,003,783</td>\n", + " <td>1,013,569</td>\n", + " <td>1,021,869</td>\n", + " <td>1,030,475</td>\n", + " <td>1,040,859</td>\n", + " <td>1,052,482</td>\n", + " <td>1,060,665</td>\n", + " <td>1,068,778</td>\n", + " <td>MT</td>\n", + " </tr>\n", + " <tr>\n", + " <th>27</th>\n", + " <td>Nebraska</td>\n", + " <td>31</td>\n", + " <td>1,829,542</td>\n", + " <td>1,840,672</td>\n", + " <td>1,853,303</td>\n", + " <td>1,865,279</td>\n", + " <td>1,879,321</td>\n", + " <td>1,891,277</td>\n", + " <td>1,905,616</td>\n", + " <td>1,915,947</td>\n", + " <td>1,925,614</td>\n", + " <td>1,934,408</td>\n", + " <td>NE</td>\n", + " </tr>\n", + " <tr>\n", + " <th>28</th>\n", + " <td>Nevada</td>\n", + " <td>32</td>\n", + " <td>2,702,405</td>\n", + " <td>2,712,730</td>\n", + " <td>2,743,996</td>\n", + " <td>2,775,970</td>\n", + " <td>2,817,628</td>\n", + " <td>2,866,939</td>\n", + " <td>2,917,563</td>\n", + " <td>2,969,905</td>\n", + " <td>3,027,341</td>\n", + " <td>3,080,156</td>\n", + " <td>NV</td>\n", + " </tr>\n", + " <tr>\n", + " <th>29</th>\n", + " <td>New Hampshire</td>\n", + " <td>33</td>\n", + " <td>1,316,762</td>\n", + " <td>1,320,202</td>\n", + " <td>1,324,232</td>\n", + " <td>1,326,622</td>\n", + " <td>1,333,341</td>\n", + " <td>1,336,350</td>\n", + " <td>1,342,307</td>\n", + " <td>1,348,787</td>\n", + " <td>1,353,465</td>\n", + " <td>1,359,711</td>\n", + " <td>NH</td>\n", + " </tr>\n", + " <tr>\n", + " <th>30</th>\n", + " <td>New Jersey</td>\n", + " <td>34</td>\n", + " <td>8,799,446</td>\n", + " <td>8,828,117</td>\n", + " <td>8,844,942</td>\n", + " <td>8,856,972</td>\n", + " <td>8,864,525</td>\n", + " <td>8,867,949</td>\n", + " <td>8,870,827</td>\n", + " <td>8,885,525</td>\n", + " <td>8,886,025</td>\n", + " <td>8,882,190</td>\n", + " <td>NJ</td>\n", + " </tr>\n", + " <tr>\n", + " <th>31</th>\n", + " <td>New Mexico</td>\n", + " <td>35</td>\n", + " <td>2,064,552</td>\n", + " <td>2,080,450</td>\n", + " <td>2,087,309</td>\n", + " <td>2,092,273</td>\n", + " <td>2,089,568</td>\n", + " <td>2,089,291</td>\n", + " <td>2,091,630</td>\n", + " <td>2,091,784</td>\n", + " <td>2,092,741</td>\n", + " <td>2,096,829</td>\n", + " <td>NM</td>\n", + " </tr>\n", + " <tr>\n", + " <th>32</th>\n", + " <td>New York</td>\n", + " <td>36</td>\n", + " <td>19,399,878</td>\n", + " <td>19,499,241</td>\n", + " <td>19,572,932</td>\n", + " <td>19,624,447</td>\n", + " <td>19,651,049</td>\n", + " <td>19,654,666</td>\n", + " <td>19,633,428</td>\n", + " <td>19,589,572</td>\n", + " <td>19,530,351</td>\n", + " <td>19,453,561</td>\n", + " <td>NY</td>\n", + " </tr>\n", + " <tr>\n", + " <th>33</th>\n", + " <td>North Carolina</td>\n", + " <td>37</td>\n", + " <td>9,574,323</td>\n", + " <td>9,657,592</td>\n", + " <td>9,749,476</td>\n", + " <td>9,843,336</td>\n", + " <td>9,932,887</td>\n", + " <td>10,031,646</td>\n", + " <td>10,154,788</td>\n", + " <td>10,268,233</td>\n", + " <td>10,381,615</td>\n", + " <td>10,488,084</td>\n", + " <td>NC</td>\n", + " </tr>\n", + " <tr>\n", + " <th>34</th>\n", + " <td>North Dakota</td>\n", + " <td>38</td>\n", + " <td>674,715</td>\n", + " <td>685,225</td>\n", + " <td>701,176</td>\n", + " <td>722,036</td>\n", + " <td>737,401</td>\n", + " <td>754,066</td>\n", + " <td>754,434</td>\n", + " <td>754,942</td>\n", + " <td>758,080</td>\n", + " <td>762,062</td>\n", + " <td>ND</td>\n", + " </tr>\n", + " <tr>\n", + " <th>35</th>\n", + " <td>Ohio</td>\n", + " <td>39</td>\n", + " <td>11,539,336</td>\n", + " <td>11,544,663</td>\n", + " <td>11,548,923</td>\n", + " <td>11,576,684</td>\n", + " <td>11,602,700</td>\n", + " <td>11,617,527</td>\n", + " <td>11,634,370</td>\n", + " <td>11,659,650</td>\n", + " <td>11,676,341</td>\n", + " <td>11,689,100</td>\n", + " <td>OH</td>\n", + " </tr>\n", + " <tr>\n", + " <th>36</th>\n", + " <td>Oklahoma</td>\n", + " <td>40</td>\n", + " <td>3,759,944</td>\n", + " <td>3,788,379</td>\n", + " <td>3,818,814</td>\n", + " <td>3,853,214</td>\n", + " <td>3,878,187</td>\n", + " <td>3,909,500</td>\n", + " <td>3,926,331</td>\n", + " <td>3,931,316</td>\n", + " <td>3,940,235</td>\n", + " <td>3,956,971</td>\n", + " <td>OK</td>\n", + " </tr>\n", + " <tr>\n", + " <th>37</th>\n", + " <td>Oregon</td>\n", + " <td>41</td>\n", + " <td>3,837,491</td>\n", + " <td>3,872,036</td>\n", + " <td>3,899,001</td>\n", + " <td>3,922,468</td>\n", + " <td>3,963,244</td>\n", + " <td>4,015,792</td>\n", + " <td>4,089,976</td>\n", + " <td>4,143,625</td>\n", + " <td>4,181,886</td>\n", + " <td>4,217,737</td>\n", + " <td>OR</td>\n", + " </tr>\n", + " <tr>\n", + " <th>38</th>\n", + " <td>Pennsylvania</td>\n", + " <td>42</td>\n", + " <td>12,711,160</td>\n", + " <td>12,745,815</td>\n", + " <td>12,767,118</td>\n", + " <td>12,776,309</td>\n", + " <td>12,788,313</td>\n", + " <td>12,784,826</td>\n", + " <td>12,782,275</td>\n", + " <td>12,787,641</td>\n", + " <td>12,800,922</td>\n", + " <td>12,801,989</td>\n", + " <td>PA</td>\n", + " </tr>\n", + " <tr>\n", + " <th>39</th>\n", + " <td>Rhode Island</td>\n", + " <td>44</td>\n", + " <td>1,053,959</td>\n", + " <td>1,053,649</td>\n", + " <td>1,054,621</td>\n", + " <td>1,055,081</td>\n", + " <td>1,055,936</td>\n", + " <td>1,056,065</td>\n", + " <td>1,056,770</td>\n", + " <td>1,055,673</td>\n", + " <td>1,058,287</td>\n", + " <td>1,059,361</td>\n", + " <td>RI</td>\n", + " </tr>\n", + " <tr>\n", + " <th>40</th>\n", + " <td>South Carolina</td>\n", + " <td>45</td>\n", + " <td>4,635,649</td>\n", + " <td>4,671,994</td>\n", + " <td>4,717,354</td>\n", + " <td>4,764,080</td>\n", + " <td>4,823,617</td>\n", + " <td>4,891,938</td>\n", + " <td>4,957,968</td>\n", + " <td>5,021,268</td>\n", + " <td>5,084,156</td>\n", + " <td>5,148,714</td>\n", + " <td>SC</td>\n", + " </tr>\n", + " <tr>\n", + " <th>41</th>\n", + " <td>South Dakota</td>\n", + " <td>46</td>\n", + " <td>816,166</td>\n", + " <td>823,579</td>\n", + " <td>833,566</td>\n", + " <td>842,316</td>\n", + " <td>849,129</td>\n", + " <td>853,988</td>\n", + " <td>862,996</td>\n", + " <td>872,868</td>\n", + " <td>878,698</td>\n", + " <td>884,659</td>\n", + " <td>SD</td>\n", + " </tr>\n", + " <tr>\n", + " <th>42</th>\n", + " <td>Tennessee</td>\n", + " <td>47</td>\n", + " <td>6,355,311</td>\n", + " <td>6,399,291</td>\n", + " <td>6,453,898</td>\n", + " <td>6,494,340</td>\n", + " <td>6,541,223</td>\n", + " <td>6,591,170</td>\n", + " <td>6,646,010</td>\n", + " <td>6,708,799</td>\n", + " <td>6,771,631</td>\n", + " <td>6,829,174</td>\n", + " <td>TN</td>\n", + " </tr>\n", + " <tr>\n", + " <th>43</th>\n", + " <td>Texas</td>\n", + " <td>48</td>\n", + " <td>25,241,971</td>\n", + " <td>25,645,629</td>\n", + " <td>26,084,481</td>\n", + " <td>26,480,266</td>\n", + " <td>26,964,333</td>\n", + " <td>27,470,056</td>\n", + " <td>27,914,410</td>\n", + " <td>28,295,273</td>\n", + " <td>28,628,666</td>\n", + " <td>28,995,881</td>\n", + " <td>TX</td>\n", + " </tr>\n", + " <tr>\n", + " <th>44</th>\n", + " <td>Utah</td>\n", + " <td>49</td>\n", + " <td>2,775,332</td>\n", + " <td>2,814,384</td>\n", + " <td>2,853,375</td>\n", + " <td>2,897,640</td>\n", + " <td>2,936,879</td>\n", + " <td>2,981,835</td>\n", + " <td>3,041,868</td>\n", + " <td>3,101,042</td>\n", + " <td>3,153,550</td>\n", + " <td>3,205,958</td>\n", + " <td>UT</td>\n", + " </tr>\n", + " <tr>\n", + " <th>45</th>\n", + " <td>Vermont</td>\n", + " <td>50</td>\n", + " <td>625,879</td>\n", + " <td>627,049</td>\n", + " <td>626,090</td>\n", + " <td>626,210</td>\n", + " <td>625,214</td>\n", + " <td>625,216</td>\n", + " <td>623,657</td>\n", + " <td>624,344</td>\n", + " <td>624,358</td>\n", + " <td>623,989</td>\n", + " <td>VT</td>\n", + " </tr>\n", + " <tr>\n", + " <th>46</th>\n", + " <td>Virginia</td>\n", + " <td>51</td>\n", + " <td>8,023,699</td>\n", + " <td>8,101,155</td>\n", + " <td>8,185,080</td>\n", + " <td>8,252,427</td>\n", + " <td>8,310,993</td>\n", + " <td>8,361,808</td>\n", + " <td>8,410,106</td>\n", + " <td>8,463,587</td>\n", + " <td>8,501,286</td>\n", + " <td>8,535,519</td>\n", + " <td>VA</td>\n", + " </tr>\n", + " <tr>\n", + " <th>47</th>\n", + " <td>Washington</td>\n", + " <td>53</td>\n", + " <td>6,742,830</td>\n", + " <td>6,826,627</td>\n", + " <td>6,897,058</td>\n", + " <td>6,963,985</td>\n", + " <td>7,054,655</td>\n", + " <td>7,163,657</td>\n", + " <td>7,294,771</td>\n", + " <td>7,423,362</td>\n", + " <td>7,523,869</td>\n", + " <td>7,614,893</td>\n", + " <td>WA</td>\n", + " </tr>\n", + " <tr>\n", + " <th>48</th>\n", + " <td>West Virginia</td>\n", + " <td>54</td>\n", + " <td>1,854,239</td>\n", + " <td>1,856,301</td>\n", + " <td>1,856,872</td>\n", + " <td>1,853,914</td>\n", + " <td>1,849,489</td>\n", + " <td>1,842,050</td>\n", + " <td>1,831,023</td>\n", + " <td>1,817,004</td>\n", + " <td>1,804,291</td>\n", + " <td>1,792,147</td>\n", + " <td>WV</td>\n", + " </tr>\n", + " <tr>\n", + " <th>49</th>\n", + " <td>Wisconsin</td>\n", + " <td>55</td>\n", + " <td>5,690,475</td>\n", + " <td>5,705,288</td>\n", + " <td>5,719,960</td>\n", + " <td>5,736,754</td>\n", + " <td>5,751,525</td>\n", + " <td>5,760,940</td>\n", + " <td>5,772,628</td>\n", + " <td>5,790,186</td>\n", + " <td>5,807,406</td>\n", + " <td>5,822,434</td>\n", + " <td>WI</td>\n", + " </tr>\n", + " <tr>\n", + " <th>50</th>\n", + " <td>Wyoming</td>\n", + " <td>56</td>\n", + " <td>564,487</td>\n", + " <td>567,299</td>\n", + " <td>576,305</td>\n", + " <td>582,122</td>\n", + " <td>582,531</td>\n", + " <td>585,613</td>\n", + " <td>584,215</td>\n", + " <td>578,931</td>\n", + " <td>577,601</td>\n", + " <td>578,759</td>\n", + " <td>WY</td>\n", + " </tr>\n", + " <tr>\n", + " <th>51</th>\n", + " <td>Puerto Rico</td>\n", + " <td>72</td>\n", + " <td>3,721,525</td>\n", + " <td>3,678,732</td>\n", + " <td>3,634,488</td>\n", + " <td>3,593,077</td>\n", + " <td>3,534,874</td>\n", + " <td>3,473,232</td>\n", + " <td>3,406,672</td>\n", + " <td>3,325,286</td>\n", + " <td>3,193,354</td>\n", + " <td>3,193,694</td>\n", + " <td>PR</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>\n", + " <div class=\"colab-df-buttons\">\n", + "\n", + " <div class=\"colab-df-container\">\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-6b182c29-32fb-4ce1-bab9-22d74ba4b8f2')\"\n", + " title=\"Convert this dataframe to an interactive table.\"\n", + " style=\"display:none;\">\n", + "\n", + " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", + " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", + " </svg>\n", + " </button>\n", + "\n", + " <style>\n", + " .colab-df-container {\n", + " display:flex;\n", + " gap: 12px;\n", + " }\n", + "\n", + " .colab-df-convert {\n", + " background-color: #E8F0FE;\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: #1967D2;\n", + " height: 32px;\n", + " padding: 0 0 0 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-convert:hover {\n", + " background-color: #E2EBFA;\n", + " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: #174EA6;\n", + " }\n", + "\n", + " .colab-df-buttons div {\n", + " margin-bottom: 4px;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert {\n", + " background-color: #3B4455;\n", + " fill: #D2E3FC;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert:hover {\n", + " background-color: #434B5C;\n", + " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", + " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", + " fill: #FFFFFF;\n", + " }\n", + " </style>\n", + "\n", + " <script>\n", + " const buttonEl =\n", + " document.querySelector('#df-6b182c29-32fb-4ce1-bab9-22d74ba4b8f2 button.colab-df-convert');\n", + " buttonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + "\n", + " async function convertToInteractive(key) {\n", + " const element = document.querySelector('#df-6b182c29-32fb-4ce1-bab9-22d74ba4b8f2');\n", + " const dataTable =\n", + " await google.colab.kernel.invokeFunction('convertToInteractive',\n", + " [key], {});\n", + " if (!dataTable) return;\n", + "\n", + " const docLinkHtml = 'Like what you see? Visit the ' +\n", + " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", + " + ' to learn more about interactive tables.';\n", + " element.innerHTML = '';\n", + " dataTable['output_type'] = 'display_data';\n", + " await google.colab.output.renderOutput(dataTable, element);\n", + " const docLink = document.createElement('div');\n", + " docLink.innerHTML = docLinkHtml;\n", + " element.appendChild(docLink);\n", + " }\n", + " </script>\n", + " </div>\n", + "\n", + "\n", + "<div id=\"df-1d47a8d1-329a-438b-b28a-142217e50b21\">\n", + " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-1d47a8d1-329a-438b-b28a-142217e50b21')\"\n", + " title=\"Suggest charts\"\n", + " style=\"display:none;\">\n", + "\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", + " width=\"24px\">\n", + " <g>\n", + " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", + " </g>\n", + "</svg>\n", + " </button>\n", + "\n", + "<style>\n", + " .colab-df-quickchart {\n", + " --bg-color: #E8F0FE;\n", + " --fill-color: #1967D2;\n", + " --hover-bg-color: #E2EBFA;\n", + " --hover-fill-color: #174EA6;\n", + " --disabled-fill-color: #AAA;\n", + " --disabled-bg-color: #DDD;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-quickchart {\n", + " --bg-color: #3B4455;\n", + " --fill-color: #D2E3FC;\n", + " --hover-bg-color: #434B5C;\n", + " --hover-fill-color: #FFFFFF;\n", + " --disabled-bg-color: #3B4455;\n", + " --disabled-fill-color: #666;\n", + " }\n", + "\n", + " .colab-df-quickchart {\n", + " background-color: var(--bg-color);\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: var(--fill-color);\n", + " height: 32px;\n", + " padding: 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-quickchart:hover {\n", + " background-color: var(--hover-bg-color);\n", + " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: var(--button-hover-fill-color);\n", + " }\n", + "\n", + " .colab-df-quickchart-complete:disabled,\n", + " .colab-df-quickchart-complete:disabled:hover {\n", + " background-color: var(--disabled-bg-color);\n", + " fill: var(--disabled-fill-color);\n", + " box-shadow: none;\n", + " }\n", + "\n", + " .colab-df-spinner {\n", + " border: 2px solid var(--fill-color);\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " animation:\n", + " spin 1s steps(1) infinite;\n", + " }\n", + "\n", + " @keyframes spin {\n", + " 0% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " border-left-color: var(--fill-color);\n", + " }\n", + " 20% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 30% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 40% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 60% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 80% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " 90% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " }\n", + "</style>\n", + "\n", + " <script>\n", + " async function quickchart(key) {\n", + " const quickchartButtonEl =\n", + " document.querySelector('#' + key + ' button');\n", + " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", + " quickchartButtonEl.classList.add('colab-df-spinner');\n", + " try {\n", + " const charts = await google.colab.kernel.invokeFunction(\n", + " 'suggestCharts', [key], {});\n", + " } catch (error) {\n", + " console.error('Error during call to suggestCharts:', error);\n", + " }\n", + " quickchartButtonEl.classList.remove('colab-df-spinner');\n", + " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", + " }\n", + " (() => {\n", + " let quickchartButtonEl =\n", + " document.querySelector('#df-1d47a8d1-329a-438b-b28a-142217e50b21 button');\n", + " quickchartButtonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + " })();\n", + " </script>\n", + "</div>\n", + " </div>\n", + " </div>\n" + ] + }, + "metadata": {}, + "execution_count": 2 + } + ] + }, + { + "cell_type": "code", + "source": [ + "df.columns" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "mvOR7hO1pRz8", + "outputId": "f40ab01b-0e3e-41fc-857f-156ada601546" + }, + "execution_count": 3, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "Index(['states', 'id', '2010', '2011', '2012', '2013', '2014', '2015', '2016',\n", + " '2017', '2018', '2019', 'states_code'],\n", + " dtype='object')" + ] + }, + "metadata": {}, + "execution_count": 3 + } + ] + }, + { + "cell_type": "code", + "source": [ + "new_columns = ['states', 'states_code', 'id', '2010', '2011', '2012', '2013', '2014', '2015', '2016',\n", + " '2017', '2018', '2019']\n", + "df = df.reindex(columns=new_columns)\n", + "df" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "p_kTM0IspU8F", + "outputId": "947ee8a6-383b-4178-f9a3-f890a7a75eb8" + }, + "execution_count": 4, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " states states_code id 2010 2011 2012 \\\n", + "0 Alabama AL 1 4,785,437 4,799,069 4,815,588 \n", + "1 Alaska AK 2 713,910 722,128 730,443 \n", + "2 Arizona AZ 4 6,407,172 6,472,643 6,554,978 \n", + "3 Arkansas AR 5 2,921,964 2,940,667 2,952,164 \n", + "4 California CA 6 37,319,502 37,638,369 37,948,800 \n", + "5 Colorado CO 8 5,047,349 5,121,108 5,192,647 \n", + "6 Connecticut CT 9 3,579,114 3,588,283 3,594,547 \n", + "7 Delaware DE 10 899,593 907,381 915,179 \n", + "8 District of Columbia DC 11 605,226 619,800 634,924 \n", + "9 Florida FL 12 18,845,537 19,053,237 19,297,822 \n", + "10 Georgia GA 13 9,711,881 9,802,431 9,901,430 \n", + "11 Hawaii HI 15 1,363,963 1,379,329 1,394,804 \n", + "12 Idaho ID 16 1,570,746 1,583,910 1,595,324 \n", + "13 Illinois IL 17 12,840,503 12,867,454 12,882,510 \n", + "14 Indiana IN 18 6,490,432 6,516,528 6,537,703 \n", + "15 Iowa IA 19 3,050,745 3,066,336 3,076,190 \n", + "16 Kansas KS 20 2,858,190 2,869,225 2,885,257 \n", + "17 Kentucky KY 21 4,348,181 4,369,821 4,386,346 \n", + "18 Louisiana LA 22 4,544,532 4,575,625 4,600,972 \n", + "19 Maine ME 23 1,327,629 1,328,284 1,327,729 \n", + "20 Maryland MD 24 5,788,645 5,839,419 5,886,992 \n", + "21 Massachusetts MA 25 6,566,307 6,613,583 6,663,005 \n", + "22 Michigan MI 26 9,877,510 9,882,412 9,897,145 \n", + "23 Minnesota MN 27 5,310,828 5,346,143 5,376,643 \n", + "24 Mississippi MS 28 2,970,548 2,978,731 2,983,816 \n", + "25 Missouri MO 29 5,995,974 6,010,275 6,024,367 \n", + "26 Montana MT 30 990,697 997,316 1,003,783 \n", + "27 Nebraska NE 31 1,829,542 1,840,672 1,853,303 \n", + "28 Nevada NV 32 2,702,405 2,712,730 2,743,996 \n", + "29 New Hampshire NH 33 1,316,762 1,320,202 1,324,232 \n", + "30 New Jersey NJ 34 8,799,446 8,828,117 8,844,942 \n", + "31 New Mexico NM 35 2,064,552 2,080,450 2,087,309 \n", + "32 New York NY 36 19,399,878 19,499,241 19,572,932 \n", + "33 North Carolina NC 37 9,574,323 9,657,592 9,749,476 \n", + "34 North Dakota ND 38 674,715 685,225 701,176 \n", + "35 Ohio OH 39 11,539,336 11,544,663 11,548,923 \n", + "36 Oklahoma OK 40 3,759,944 3,788,379 3,818,814 \n", + "37 Oregon OR 41 3,837,491 3,872,036 3,899,001 \n", + "38 Pennsylvania PA 42 12,711,160 12,745,815 12,767,118 \n", + "39 Rhode Island RI 44 1,053,959 1,053,649 1,054,621 \n", + "40 South Carolina SC 45 4,635,649 4,671,994 4,717,354 \n", + "41 South Dakota SD 46 816,166 823,579 833,566 \n", + "42 Tennessee TN 47 6,355,311 6,399,291 6,453,898 \n", + "43 Texas TX 48 25,241,971 25,645,629 26,084,481 \n", + "44 Utah UT 49 2,775,332 2,814,384 2,853,375 \n", + "45 Vermont VT 50 625,879 627,049 626,090 \n", + "46 Virginia VA 51 8,023,699 8,101,155 8,185,080 \n", + "47 Washington WA 53 6,742,830 6,826,627 6,897,058 \n", + "48 West Virginia WV 54 1,854,239 1,856,301 1,856,872 \n", + "49 Wisconsin WI 55 5,690,475 5,705,288 5,719,960 \n", + "50 Wyoming WY 56 564,487 567,299 576,305 \n", + "51 Puerto Rico PR 72 3,721,525 3,678,732 3,634,488 \n", + "\n", + " 2013 2014 2015 2016 2017 2018 \\\n", + "0 4,830,081 4,841,799 4,852,347 4,863,525 4,874,486 4,887,681 \n", + "1 737,068 736,283 737,498 741,456 739,700 735,139 \n", + "2 6,632,764 6,730,413 6,829,676 6,941,072 7,044,008 7,158,024 \n", + "3 2,959,400 2,967,392 2,978,048 2,989,918 3,001,345 3,009,733 \n", + "4 38,260,787 38,596,972 38,918,045 39,167,117 39,358,497 39,461,588 \n", + "5 5,269,035 5,350,101 5,450,623 5,539,215 5,611,885 5,691,287 \n", + "6 3,594,841 3,594,524 3,587,122 3,578,141 3,573,297 3,571,520 \n", + "7 923,576 932,487 941,252 948,921 956,823 965,479 \n", + "8 650,581 662,328 675,400 685,815 694,906 701,547 \n", + "9 19,545,621 19,845,911 20,209,042 20,613,477 20,963,613 21,244,317 \n", + "10 9,972,479 10,067,278 10,178,447 10,301,890 10,410,330 10,511,131 \n", + "11 1,408,243 1,414,538 1,422,052 1,427,559 1,424,393 1,420,593 \n", + "12 1,611,206 1,631,112 1,651,059 1,682,380 1,717,715 1,750,536 \n", + "13 12,895,129 12,884,493 12,858,913 12,820,527 12,778,828 12,723,071 \n", + "14 6,568,713 6,593,644 6,608,422 6,634,304 6,658,078 6,695,497 \n", + "15 3,092,997 3,109,350 3,120,960 3,131,371 3,141,550 3,148,618 \n", + "16 2,893,212 2,900,475 2,909,011 2,910,844 2,908,718 2,911,359 \n", + "17 4,404,659 4,414,349 4,425,976 4,438,182 4,452,268 4,461,153 \n", + "18 4,624,527 4,644,013 4,664,628 4,678,135 4,670,560 4,659,690 \n", + "19 1,328,009 1,330,513 1,328,262 1,331,317 1,334,612 1,339,057 \n", + "20 5,923,188 5,957,283 5,985,562 6,003,323 6,023,868 6,035,802 \n", + "21 6,713,315 6,762,596 6,794,228 6,823,608 6,859,789 6,882,635 \n", + "22 9,913,065 9,929,848 9,931,715 9,950,571 9,973,114 9,984,072 \n", + "23 5,413,479 5,451,079 5,482,032 5,522,744 5,566,230 5,606,249 \n", + "24 2,988,711 2,990,468 2,988,471 2,987,938 2,988,510 2,981,020 \n", + "25 6,040,715 6,056,202 6,071,732 6,087,135 6,106,670 6,121,623 \n", + "26 1,013,569 1,021,869 1,030,475 1,040,859 1,052,482 1,060,665 \n", + "27 1,865,279 1,879,321 1,891,277 1,905,616 1,915,947 1,925,614 \n", + "28 2,775,970 2,817,628 2,866,939 2,917,563 2,969,905 3,027,341 \n", + "29 1,326,622 1,333,341 1,336,350 1,342,307 1,348,787 1,353,465 \n", + "30 8,856,972 8,864,525 8,867,949 8,870,827 8,885,525 8,886,025 \n", + "31 2,092,273 2,089,568 2,089,291 2,091,630 2,091,784 2,092,741 \n", + "32 19,624,447 19,651,049 19,654,666 19,633,428 19,589,572 19,530,351 \n", + "33 9,843,336 9,932,887 10,031,646 10,154,788 10,268,233 10,381,615 \n", + "34 722,036 737,401 754,066 754,434 754,942 758,080 \n", + "35 11,576,684 11,602,700 11,617,527 11,634,370 11,659,650 11,676,341 \n", + "36 3,853,214 3,878,187 3,909,500 3,926,331 3,931,316 3,940,235 \n", + "37 3,922,468 3,963,244 4,015,792 4,089,976 4,143,625 4,181,886 \n", + "38 12,776,309 12,788,313 12,784,826 12,782,275 12,787,641 12,800,922 \n", + "39 1,055,081 1,055,936 1,056,065 1,056,770 1,055,673 1,058,287 \n", + "40 4,764,080 4,823,617 4,891,938 4,957,968 5,021,268 5,084,156 \n", + "41 842,316 849,129 853,988 862,996 872,868 878,698 \n", + "42 6,494,340 6,541,223 6,591,170 6,646,010 6,708,799 6,771,631 \n", + "43 26,480,266 26,964,333 27,470,056 27,914,410 28,295,273 28,628,666 \n", + "44 2,897,640 2,936,879 2,981,835 3,041,868 3,101,042 3,153,550 \n", + "45 626,210 625,214 625,216 623,657 624,344 624,358 \n", + "46 8,252,427 8,310,993 8,361,808 8,410,106 8,463,587 8,501,286 \n", + "47 6,963,985 7,054,655 7,163,657 7,294,771 7,423,362 7,523,869 \n", + "48 1,853,914 1,849,489 1,842,050 1,831,023 1,817,004 1,804,291 \n", + "49 5,736,754 5,751,525 5,760,940 5,772,628 5,790,186 5,807,406 \n", + "50 582,122 582,531 585,613 584,215 578,931 577,601 \n", + "51 3,593,077 3,534,874 3,473,232 3,406,672 3,325,286 3,193,354 \n", + "\n", + " 2019 \n", + "0 4,903,185 \n", + "1 731,545 \n", + "2 7,278,717 \n", + "3 3,017,804 \n", + "4 39,512,223 \n", + "5 5,758,736 \n", + "6 3,565,287 \n", + "7 973,764 \n", + "8 705,749 \n", + "9 21,477,737 \n", + "10 10,617,423 \n", + "11 1,415,872 \n", + "12 1,787,065 \n", + "13 12,671,821 \n", + "14 6,732,219 \n", + "15 3,155,070 \n", + "16 2,913,314 \n", + "17 4,467,673 \n", + "18 4,648,794 \n", + "19 1,344,212 \n", + "20 6,045,680 \n", + "21 6,892,503 \n", + "22 9,986,857 \n", + "23 5,639,632 \n", + "24 2,976,149 \n", + "25 6,137,428 \n", + "26 1,068,778 \n", + "27 1,934,408 \n", + "28 3,080,156 \n", + "29 1,359,711 \n", + "30 8,882,190 \n", + "31 2,096,829 \n", + "32 19,453,561 \n", + "33 10,488,084 \n", + "34 762,062 \n", + "35 11,689,100 \n", + "36 3,956,971 \n", + "37 4,217,737 \n", + "38 12,801,989 \n", + "39 1,059,361 \n", + "40 5,148,714 \n", + "41 884,659 \n", + "42 6,829,174 \n", + "43 28,995,881 \n", + "44 3,205,958 \n", + "45 623,989 \n", + "46 8,535,519 \n", + "47 7,614,893 \n", + "48 1,792,147 \n", + "49 5,822,434 \n", + "50 578,759 \n", + "51 3,193,694 " + ], + "text/html": [ + "\n", + " <div id=\"df-dccb6b9c-bd3e-4959-ab64-fe4534c0c405\" class=\"colab-df-container\">\n", + " <div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>states</th>\n", + " <th>states_code</th>\n", + " <th>id</th>\n", + " <th>2010</th>\n", + " <th>2011</th>\n", + " <th>2012</th>\n", + " <th>2013</th>\n", + " <th>2014</th>\n", + " <th>2015</th>\n", + " <th>2016</th>\n", + " <th>2017</th>\n", + " <th>2018</th>\n", + " <th>2019</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>Alabama</td>\n", + " <td>AL</td>\n", + " <td>1</td>\n", + " <td>4,785,437</td>\n", + " <td>4,799,069</td>\n", + " <td>4,815,588</td>\n", + " <td>4,830,081</td>\n", + " <td>4,841,799</td>\n", + " <td>4,852,347</td>\n", + " <td>4,863,525</td>\n", + " <td>4,874,486</td>\n", + " <td>4,887,681</td>\n", + " <td>4,903,185</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>Alaska</td>\n", + " <td>AK</td>\n", + " <td>2</td>\n", + " <td>713,910</td>\n", + " <td>722,128</td>\n", + " <td>730,443</td>\n", + " <td>737,068</td>\n", + " <td>736,283</td>\n", + " <td>737,498</td>\n", + " <td>741,456</td>\n", + " <td>739,700</td>\n", + " <td>735,139</td>\n", + " <td>731,545</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <td>Arizona</td>\n", + " <td>AZ</td>\n", + " <td>4</td>\n", + " <td>6,407,172</td>\n", + " <td>6,472,643</td>\n", + " <td>6,554,978</td>\n", + " <td>6,632,764</td>\n", + " <td>6,730,413</td>\n", + " <td>6,829,676</td>\n", + " <td>6,941,072</td>\n", + " <td>7,044,008</td>\n", + " <td>7,158,024</td>\n", + " <td>7,278,717</td>\n", + " </tr>\n", + " <tr>\n", + " <th>3</th>\n", + " <td>Arkansas</td>\n", + " <td>AR</td>\n", + " <td>5</td>\n", + " <td>2,921,964</td>\n", + " <td>2,940,667</td>\n", + " <td>2,952,164</td>\n", + " <td>2,959,400</td>\n", + " <td>2,967,392</td>\n", + " <td>2,978,048</td>\n", + " <td>2,989,918</td>\n", + " <td>3,001,345</td>\n", + " <td>3,009,733</td>\n", + " <td>3,017,804</td>\n", + " </tr>\n", + " <tr>\n", + " <th>4</th>\n", + " <td>California</td>\n", + " <td>CA</td>\n", + " <td>6</td>\n", + " <td>37,319,502</td>\n", + " <td>37,638,369</td>\n", + " <td>37,948,800</td>\n", + " <td>38,260,787</td>\n", + " <td>38,596,972</td>\n", + " <td>38,918,045</td>\n", + " <td>39,167,117</td>\n", + " <td>39,358,497</td>\n", + " <td>39,461,588</td>\n", + " <td>39,512,223</td>\n", + " </tr>\n", + " <tr>\n", + " <th>5</th>\n", + " <td>Colorado</td>\n", + " <td>CO</td>\n", + " <td>8</td>\n", + " <td>5,047,349</td>\n", + " <td>5,121,108</td>\n", + " <td>5,192,647</td>\n", + " <td>5,269,035</td>\n", + " <td>5,350,101</td>\n", + " <td>5,450,623</td>\n", + " <td>5,539,215</td>\n", + " <td>5,611,885</td>\n", + " <td>5,691,287</td>\n", + " <td>5,758,736</td>\n", + " </tr>\n", + " <tr>\n", + " <th>6</th>\n", + " <td>Connecticut</td>\n", + " <td>CT</td>\n", + " <td>9</td>\n", + " <td>3,579,114</td>\n", + " <td>3,588,283</td>\n", + " <td>3,594,547</td>\n", + " <td>3,594,841</td>\n", + " <td>3,594,524</td>\n", + " <td>3,587,122</td>\n", + " <td>3,578,141</td>\n", + " <td>3,573,297</td>\n", + " <td>3,571,520</td>\n", + " <td>3,565,287</td>\n", + " </tr>\n", + " <tr>\n", + " <th>7</th>\n", + " <td>Delaware</td>\n", + " <td>DE</td>\n", + " <td>10</td>\n", + " <td>899,593</td>\n", + " <td>907,381</td>\n", + " <td>915,179</td>\n", + " <td>923,576</td>\n", + " <td>932,487</td>\n", + " <td>941,252</td>\n", + " <td>948,921</td>\n", + " <td>956,823</td>\n", + " <td>965,479</td>\n", + " <td>973,764</td>\n", + " </tr>\n", + " <tr>\n", + " <th>8</th>\n", + " <td>District of Columbia</td>\n", + " <td>DC</td>\n", + " <td>11</td>\n", + " <td>605,226</td>\n", + " <td>619,800</td>\n", + " <td>634,924</td>\n", + " <td>650,581</td>\n", + " <td>662,328</td>\n", + " <td>675,400</td>\n", + " <td>685,815</td>\n", + " <td>694,906</td>\n", + " <td>701,547</td>\n", + " <td>705,749</td>\n", + " </tr>\n", + " <tr>\n", + " <th>9</th>\n", + " <td>Florida</td>\n", + " <td>FL</td>\n", + " <td>12</td>\n", + " <td>18,845,537</td>\n", + " <td>19,053,237</td>\n", + " <td>19,297,822</td>\n", + " <td>19,545,621</td>\n", + " <td>19,845,911</td>\n", + " <td>20,209,042</td>\n", + " <td>20,613,477</td>\n", + " <td>20,963,613</td>\n", + " <td>21,244,317</td>\n", + " <td>21,477,737</td>\n", + " </tr>\n", + " <tr>\n", + " <th>10</th>\n", + " <td>Georgia</td>\n", + " <td>GA</td>\n", + " <td>13</td>\n", + " <td>9,711,881</td>\n", + " <td>9,802,431</td>\n", + " <td>9,901,430</td>\n", + " <td>9,972,479</td>\n", + " <td>10,067,278</td>\n", + " <td>10,178,447</td>\n", + " <td>10,301,890</td>\n", + " <td>10,410,330</td>\n", + " <td>10,511,131</td>\n", + " <td>10,617,423</td>\n", + " </tr>\n", + " <tr>\n", + " <th>11</th>\n", + " <td>Hawaii</td>\n", + " <td>HI</td>\n", + " <td>15</td>\n", + " <td>1,363,963</td>\n", + " <td>1,379,329</td>\n", + " <td>1,394,804</td>\n", + " <td>1,408,243</td>\n", + " <td>1,414,538</td>\n", + " <td>1,422,052</td>\n", + " <td>1,427,559</td>\n", + " <td>1,424,393</td>\n", + " <td>1,420,593</td>\n", + " <td>1,415,872</td>\n", + " </tr>\n", + " <tr>\n", + " <th>12</th>\n", + " <td>Idaho</td>\n", + " <td>ID</td>\n", + " <td>16</td>\n", + " <td>1,570,746</td>\n", + " <td>1,583,910</td>\n", + " <td>1,595,324</td>\n", + " <td>1,611,206</td>\n", + " <td>1,631,112</td>\n", + " <td>1,651,059</td>\n", + " <td>1,682,380</td>\n", + " <td>1,717,715</td>\n", + " <td>1,750,536</td>\n", + " <td>1,787,065</td>\n", + " </tr>\n", + " <tr>\n", + " <th>13</th>\n", + " <td>Illinois</td>\n", + " <td>IL</td>\n", + " <td>17</td>\n", + " <td>12,840,503</td>\n", + " <td>12,867,454</td>\n", + " <td>12,882,510</td>\n", + " <td>12,895,129</td>\n", + " <td>12,884,493</td>\n", + " <td>12,858,913</td>\n", + " <td>12,820,527</td>\n", + " <td>12,778,828</td>\n", + " <td>12,723,071</td>\n", + " <td>12,671,821</td>\n", + " </tr>\n", + " <tr>\n", + " <th>14</th>\n", + " <td>Indiana</td>\n", + " <td>IN</td>\n", + " <td>18</td>\n", + " <td>6,490,432</td>\n", + " <td>6,516,528</td>\n", + " <td>6,537,703</td>\n", + " <td>6,568,713</td>\n", + " <td>6,593,644</td>\n", + " <td>6,608,422</td>\n", + " <td>6,634,304</td>\n", + " <td>6,658,078</td>\n", + " <td>6,695,497</td>\n", + " <td>6,732,219</td>\n", + " </tr>\n", + " <tr>\n", + " <th>15</th>\n", + " <td>Iowa</td>\n", + " <td>IA</td>\n", + " <td>19</td>\n", + " <td>3,050,745</td>\n", + " <td>3,066,336</td>\n", + " <td>3,076,190</td>\n", + " <td>3,092,997</td>\n", + " <td>3,109,350</td>\n", + " <td>3,120,960</td>\n", + " <td>3,131,371</td>\n", + " <td>3,141,550</td>\n", + " <td>3,148,618</td>\n", + " <td>3,155,070</td>\n", + " </tr>\n", + " <tr>\n", + " <th>16</th>\n", + " <td>Kansas</td>\n", + " <td>KS</td>\n", + " <td>20</td>\n", + " <td>2,858,190</td>\n", + " <td>2,869,225</td>\n", + " <td>2,885,257</td>\n", + " <td>2,893,212</td>\n", + " <td>2,900,475</td>\n", + " <td>2,909,011</td>\n", + " <td>2,910,844</td>\n", + " <td>2,908,718</td>\n", + " <td>2,911,359</td>\n", + " <td>2,913,314</td>\n", + " </tr>\n", + " <tr>\n", + " <th>17</th>\n", + " <td>Kentucky</td>\n", + " <td>KY</td>\n", + " <td>21</td>\n", + " <td>4,348,181</td>\n", + " <td>4,369,821</td>\n", + " <td>4,386,346</td>\n", + " <td>4,404,659</td>\n", + " <td>4,414,349</td>\n", + " <td>4,425,976</td>\n", + " <td>4,438,182</td>\n", + " <td>4,452,268</td>\n", + " <td>4,461,153</td>\n", + " <td>4,467,673</td>\n", + " </tr>\n", + " <tr>\n", + " <th>18</th>\n", + " <td>Louisiana</td>\n", + " <td>LA</td>\n", + " <td>22</td>\n", + " <td>4,544,532</td>\n", + " <td>4,575,625</td>\n", + " <td>4,600,972</td>\n", + " <td>4,624,527</td>\n", + " <td>4,644,013</td>\n", + " <td>4,664,628</td>\n", + " <td>4,678,135</td>\n", + " <td>4,670,560</td>\n", + " <td>4,659,690</td>\n", + " <td>4,648,794</td>\n", + " </tr>\n", + " <tr>\n", + " <th>19</th>\n", + " <td>Maine</td>\n", + " <td>ME</td>\n", + " <td>23</td>\n", + " <td>1,327,629</td>\n", + " <td>1,328,284</td>\n", + " <td>1,327,729</td>\n", + " <td>1,328,009</td>\n", + " <td>1,330,513</td>\n", + " <td>1,328,262</td>\n", + " <td>1,331,317</td>\n", + " <td>1,334,612</td>\n", + " <td>1,339,057</td>\n", + " <td>1,344,212</td>\n", + " </tr>\n", + " <tr>\n", + " <th>20</th>\n", + " <td>Maryland</td>\n", + " <td>MD</td>\n", + " <td>24</td>\n", + " <td>5,788,645</td>\n", + " <td>5,839,419</td>\n", + " <td>5,886,992</td>\n", + " <td>5,923,188</td>\n", + " <td>5,957,283</td>\n", + " <td>5,985,562</td>\n", + " <td>6,003,323</td>\n", + " <td>6,023,868</td>\n", + " <td>6,035,802</td>\n", + " <td>6,045,680</td>\n", + " </tr>\n", + " <tr>\n", + " <th>21</th>\n", + " <td>Massachusetts</td>\n", + " <td>MA</td>\n", + " <td>25</td>\n", + " <td>6,566,307</td>\n", + " <td>6,613,583</td>\n", + " <td>6,663,005</td>\n", + " <td>6,713,315</td>\n", + " <td>6,762,596</td>\n", + " <td>6,794,228</td>\n", + " <td>6,823,608</td>\n", + " <td>6,859,789</td>\n", + " <td>6,882,635</td>\n", + " <td>6,892,503</td>\n", + " </tr>\n", + " <tr>\n", + " <th>22</th>\n", + " <td>Michigan</td>\n", + " <td>MI</td>\n", + " <td>26</td>\n", + " <td>9,877,510</td>\n", + " <td>9,882,412</td>\n", + " <td>9,897,145</td>\n", + " <td>9,913,065</td>\n", + " <td>9,929,848</td>\n", + " <td>9,931,715</td>\n", + " <td>9,950,571</td>\n", + " <td>9,973,114</td>\n", + " <td>9,984,072</td>\n", + " <td>9,986,857</td>\n", + " </tr>\n", + " <tr>\n", + " <th>23</th>\n", + " <td>Minnesota</td>\n", + " <td>MN</td>\n", + " <td>27</td>\n", + " <td>5,310,828</td>\n", + " <td>5,346,143</td>\n", + " <td>5,376,643</td>\n", + " <td>5,413,479</td>\n", + " <td>5,451,079</td>\n", + " <td>5,482,032</td>\n", + " <td>5,522,744</td>\n", + " <td>5,566,230</td>\n", + " <td>5,606,249</td>\n", + " <td>5,639,632</td>\n", + " </tr>\n", + " <tr>\n", + " <th>24</th>\n", + " <td>Mississippi</td>\n", + " <td>MS</td>\n", + " <td>28</td>\n", + " <td>2,970,548</td>\n", + " <td>2,978,731</td>\n", + " <td>2,983,816</td>\n", + " <td>2,988,711</td>\n", + " <td>2,990,468</td>\n", + " <td>2,988,471</td>\n", + " <td>2,987,938</td>\n", + " <td>2,988,510</td>\n", + " <td>2,981,020</td>\n", + " <td>2,976,149</td>\n", + " </tr>\n", + " <tr>\n", + " <th>25</th>\n", + " <td>Missouri</td>\n", + " <td>MO</td>\n", + " <td>29</td>\n", + " <td>5,995,974</td>\n", + " <td>6,010,275</td>\n", + " <td>6,024,367</td>\n", + " <td>6,040,715</td>\n", + " <td>6,056,202</td>\n", + " <td>6,071,732</td>\n", + " <td>6,087,135</td>\n", + " <td>6,106,670</td>\n", + " <td>6,121,623</td>\n", + " <td>6,137,428</td>\n", + " </tr>\n", + " <tr>\n", + " <th>26</th>\n", + " <td>Montana</td>\n", + " <td>MT</td>\n", + " <td>30</td>\n", + " <td>990,697</td>\n", + " <td>997,316</td>\n", + " <td>1,003,783</td>\n", + " <td>1,013,569</td>\n", + " <td>1,021,869</td>\n", + " <td>1,030,475</td>\n", + " <td>1,040,859</td>\n", + " <td>1,052,482</td>\n", + " <td>1,060,665</td>\n", + " <td>1,068,778</td>\n", + " </tr>\n", + " <tr>\n", + " <th>27</th>\n", + " <td>Nebraska</td>\n", + " <td>NE</td>\n", + " <td>31</td>\n", + " <td>1,829,542</td>\n", + " <td>1,840,672</td>\n", + " <td>1,853,303</td>\n", + " <td>1,865,279</td>\n", + " <td>1,879,321</td>\n", + " <td>1,891,277</td>\n", + " <td>1,905,616</td>\n", + " <td>1,915,947</td>\n", + " <td>1,925,614</td>\n", + " <td>1,934,408</td>\n", + " </tr>\n", + " <tr>\n", + " <th>28</th>\n", + " <td>Nevada</td>\n", + " <td>NV</td>\n", + " <td>32</td>\n", + " <td>2,702,405</td>\n", + " <td>2,712,730</td>\n", + " <td>2,743,996</td>\n", + " <td>2,775,970</td>\n", + " <td>2,817,628</td>\n", + " <td>2,866,939</td>\n", + " <td>2,917,563</td>\n", + " <td>2,969,905</td>\n", + " <td>3,027,341</td>\n", + " <td>3,080,156</td>\n", + " </tr>\n", + " <tr>\n", + " <th>29</th>\n", + " <td>New Hampshire</td>\n", + " <td>NH</td>\n", + " <td>33</td>\n", + " <td>1,316,762</td>\n", + " <td>1,320,202</td>\n", + " <td>1,324,232</td>\n", + " <td>1,326,622</td>\n", + " <td>1,333,341</td>\n", + " <td>1,336,350</td>\n", + " <td>1,342,307</td>\n", + " <td>1,348,787</td>\n", + " <td>1,353,465</td>\n", + " <td>1,359,711</td>\n", + " </tr>\n", + " <tr>\n", + " <th>30</th>\n", + " <td>New Jersey</td>\n", + " <td>NJ</td>\n", + " <td>34</td>\n", + " <td>8,799,446</td>\n", + " <td>8,828,117</td>\n", + " <td>8,844,942</td>\n", + " <td>8,856,972</td>\n", + " <td>8,864,525</td>\n", + " <td>8,867,949</td>\n", + " <td>8,870,827</td>\n", + " <td>8,885,525</td>\n", + " <td>8,886,025</td>\n", + " <td>8,882,190</td>\n", + " </tr>\n", + " <tr>\n", + " <th>31</th>\n", + " <td>New Mexico</td>\n", + " <td>NM</td>\n", + " <td>35</td>\n", + " <td>2,064,552</td>\n", + " <td>2,080,450</td>\n", + " <td>2,087,309</td>\n", + " <td>2,092,273</td>\n", + " <td>2,089,568</td>\n", + " <td>2,089,291</td>\n", + " <td>2,091,630</td>\n", + " <td>2,091,784</td>\n", + " <td>2,092,741</td>\n", + " <td>2,096,829</td>\n", + " </tr>\n", + " <tr>\n", + " <th>32</th>\n", + " <td>New York</td>\n", + " <td>NY</td>\n", + " <td>36</td>\n", + " <td>19,399,878</td>\n", + " <td>19,499,241</td>\n", + " <td>19,572,932</td>\n", + " <td>19,624,447</td>\n", + " <td>19,651,049</td>\n", + " <td>19,654,666</td>\n", + " <td>19,633,428</td>\n", + " <td>19,589,572</td>\n", + " <td>19,530,351</td>\n", + " <td>19,453,561</td>\n", + " </tr>\n", + " <tr>\n", + " <th>33</th>\n", + " <td>North Carolina</td>\n", + " <td>NC</td>\n", + " <td>37</td>\n", + " <td>9,574,323</td>\n", + " <td>9,657,592</td>\n", + " <td>9,749,476</td>\n", + " <td>9,843,336</td>\n", + " <td>9,932,887</td>\n", + " <td>10,031,646</td>\n", + " <td>10,154,788</td>\n", + " <td>10,268,233</td>\n", + " <td>10,381,615</td>\n", + " <td>10,488,084</td>\n", + " </tr>\n", + " <tr>\n", + " <th>34</th>\n", + " <td>North Dakota</td>\n", + " <td>ND</td>\n", + " <td>38</td>\n", + " <td>674,715</td>\n", + " <td>685,225</td>\n", + " <td>701,176</td>\n", + " <td>722,036</td>\n", + " <td>737,401</td>\n", + " <td>754,066</td>\n", + " <td>754,434</td>\n", + " <td>754,942</td>\n", + " <td>758,080</td>\n", + " <td>762,062</td>\n", + " </tr>\n", + " <tr>\n", + " <th>35</th>\n", + " <td>Ohio</td>\n", + " <td>OH</td>\n", + " <td>39</td>\n", + " <td>11,539,336</td>\n", + " <td>11,544,663</td>\n", + " <td>11,548,923</td>\n", + " <td>11,576,684</td>\n", + " <td>11,602,700</td>\n", + " <td>11,617,527</td>\n", + " <td>11,634,370</td>\n", + " <td>11,659,650</td>\n", + " <td>11,676,341</td>\n", + " <td>11,689,100</td>\n", + " </tr>\n", + " <tr>\n", + " <th>36</th>\n", + " <td>Oklahoma</td>\n", + " <td>OK</td>\n", + " <td>40</td>\n", + " <td>3,759,944</td>\n", + " <td>3,788,379</td>\n", + " <td>3,818,814</td>\n", + " <td>3,853,214</td>\n", + " <td>3,878,187</td>\n", + " <td>3,909,500</td>\n", + " <td>3,926,331</td>\n", + " <td>3,931,316</td>\n", + " <td>3,940,235</td>\n", + " <td>3,956,971</td>\n", + " </tr>\n", + " <tr>\n", + " <th>37</th>\n", + " <td>Oregon</td>\n", + " <td>OR</td>\n", + " <td>41</td>\n", + " <td>3,837,491</td>\n", + " <td>3,872,036</td>\n", + " <td>3,899,001</td>\n", + " <td>3,922,468</td>\n", + " <td>3,963,244</td>\n", + " <td>4,015,792</td>\n", + " <td>4,089,976</td>\n", + " <td>4,143,625</td>\n", + " <td>4,181,886</td>\n", + " <td>4,217,737</td>\n", + " </tr>\n", + " <tr>\n", + " <th>38</th>\n", + " <td>Pennsylvania</td>\n", + " <td>PA</td>\n", + " <td>42</td>\n", + " <td>12,711,160</td>\n", + " <td>12,745,815</td>\n", + " <td>12,767,118</td>\n", + " <td>12,776,309</td>\n", + " <td>12,788,313</td>\n", + " <td>12,784,826</td>\n", + " <td>12,782,275</td>\n", + " <td>12,787,641</td>\n", + " <td>12,800,922</td>\n", + " <td>12,801,989</td>\n", + " </tr>\n", + " <tr>\n", + " <th>39</th>\n", + " <td>Rhode Island</td>\n", + " <td>RI</td>\n", + " <td>44</td>\n", + " <td>1,053,959</td>\n", + " <td>1,053,649</td>\n", + " <td>1,054,621</td>\n", + " <td>1,055,081</td>\n", + " <td>1,055,936</td>\n", + " <td>1,056,065</td>\n", + " <td>1,056,770</td>\n", + " <td>1,055,673</td>\n", + " <td>1,058,287</td>\n", + " <td>1,059,361</td>\n", + " </tr>\n", + " <tr>\n", + " <th>40</th>\n", + " <td>South Carolina</td>\n", + " <td>SC</td>\n", + " <td>45</td>\n", + " <td>4,635,649</td>\n", + " <td>4,671,994</td>\n", + " <td>4,717,354</td>\n", + " <td>4,764,080</td>\n", + " <td>4,823,617</td>\n", + " <td>4,891,938</td>\n", + " <td>4,957,968</td>\n", + " <td>5,021,268</td>\n", + " <td>5,084,156</td>\n", + " <td>5,148,714</td>\n", + " </tr>\n", + " <tr>\n", + " <th>41</th>\n", + " <td>South Dakota</td>\n", + " <td>SD</td>\n", + " <td>46</td>\n", + " <td>816,166</td>\n", + " <td>823,579</td>\n", + " <td>833,566</td>\n", + " <td>842,316</td>\n", + " <td>849,129</td>\n", + " <td>853,988</td>\n", + " <td>862,996</td>\n", + " <td>872,868</td>\n", + " <td>878,698</td>\n", + " <td>884,659</td>\n", + " </tr>\n", + " <tr>\n", + " <th>42</th>\n", + " <td>Tennessee</td>\n", + " <td>TN</td>\n", + " <td>47</td>\n", + " <td>6,355,311</td>\n", + " <td>6,399,291</td>\n", + " <td>6,453,898</td>\n", + " <td>6,494,340</td>\n", + " <td>6,541,223</td>\n", + " <td>6,591,170</td>\n", + " <td>6,646,010</td>\n", + " <td>6,708,799</td>\n", + " <td>6,771,631</td>\n", + " <td>6,829,174</td>\n", + " </tr>\n", + " <tr>\n", + " <th>43</th>\n", + " <td>Texas</td>\n", + " <td>TX</td>\n", + " <td>48</td>\n", + " <td>25,241,971</td>\n", + " <td>25,645,629</td>\n", + " <td>26,084,481</td>\n", + " <td>26,480,266</td>\n", + " <td>26,964,333</td>\n", + " <td>27,470,056</td>\n", + " <td>27,914,410</td>\n", + " <td>28,295,273</td>\n", + " <td>28,628,666</td>\n", + " <td>28,995,881</td>\n", + " </tr>\n", + " <tr>\n", + " <th>44</th>\n", + " <td>Utah</td>\n", + " <td>UT</td>\n", + " <td>49</td>\n", + " <td>2,775,332</td>\n", + " <td>2,814,384</td>\n", + " <td>2,853,375</td>\n", + " <td>2,897,640</td>\n", + " <td>2,936,879</td>\n", + " <td>2,981,835</td>\n", + " <td>3,041,868</td>\n", + " <td>3,101,042</td>\n", + " <td>3,153,550</td>\n", + " <td>3,205,958</td>\n", + " </tr>\n", + " <tr>\n", + " <th>45</th>\n", + " <td>Vermont</td>\n", + " <td>VT</td>\n", + " <td>50</td>\n", + " <td>625,879</td>\n", + " <td>627,049</td>\n", + " <td>626,090</td>\n", + " <td>626,210</td>\n", + " <td>625,214</td>\n", + " <td>625,216</td>\n", + " <td>623,657</td>\n", + " <td>624,344</td>\n", + " <td>624,358</td>\n", + " <td>623,989</td>\n", + " </tr>\n", + " <tr>\n", + " <th>46</th>\n", + " <td>Virginia</td>\n", + " <td>VA</td>\n", + " <td>51</td>\n", + " <td>8,023,699</td>\n", + " <td>8,101,155</td>\n", + " <td>8,185,080</td>\n", + " <td>8,252,427</td>\n", + " <td>8,310,993</td>\n", + " <td>8,361,808</td>\n", + " <td>8,410,106</td>\n", + " <td>8,463,587</td>\n", + " <td>8,501,286</td>\n", + " <td>8,535,519</td>\n", + " </tr>\n", + " <tr>\n", + " <th>47</th>\n", + " <td>Washington</td>\n", + " <td>WA</td>\n", + " <td>53</td>\n", + " <td>6,742,830</td>\n", + " <td>6,826,627</td>\n", + " <td>6,897,058</td>\n", + " <td>6,963,985</td>\n", + " <td>7,054,655</td>\n", + " <td>7,163,657</td>\n", + " <td>7,294,771</td>\n", + " <td>7,423,362</td>\n", + " <td>7,523,869</td>\n", + " <td>7,614,893</td>\n", + " </tr>\n", + " <tr>\n", + " <th>48</th>\n", + " <td>West Virginia</td>\n", + " <td>WV</td>\n", + " <td>54</td>\n", + " <td>1,854,239</td>\n", + " <td>1,856,301</td>\n", + " <td>1,856,872</td>\n", + " <td>1,853,914</td>\n", + " <td>1,849,489</td>\n", + " <td>1,842,050</td>\n", + " <td>1,831,023</td>\n", + " <td>1,817,004</td>\n", + " <td>1,804,291</td>\n", + " <td>1,792,147</td>\n", + " </tr>\n", + " <tr>\n", + " <th>49</th>\n", + " <td>Wisconsin</td>\n", + " <td>WI</td>\n", + " <td>55</td>\n", + " <td>5,690,475</td>\n", + " <td>5,705,288</td>\n", + " <td>5,719,960</td>\n", + " <td>5,736,754</td>\n", + " <td>5,751,525</td>\n", + " <td>5,760,940</td>\n", + " <td>5,772,628</td>\n", + " <td>5,790,186</td>\n", + " <td>5,807,406</td>\n", + " <td>5,822,434</td>\n", + " </tr>\n", + " <tr>\n", + " <th>50</th>\n", + " <td>Wyoming</td>\n", + " <td>WY</td>\n", + " <td>56</td>\n", + " <td>564,487</td>\n", + " <td>567,299</td>\n", + " <td>576,305</td>\n", + " <td>582,122</td>\n", + " <td>582,531</td>\n", + " <td>585,613</td>\n", + " <td>584,215</td>\n", + " <td>578,931</td>\n", + " <td>577,601</td>\n", + " <td>578,759</td>\n", + " </tr>\n", + " <tr>\n", + " <th>51</th>\n", + " <td>Puerto Rico</td>\n", + " <td>PR</td>\n", + " <td>72</td>\n", + " <td>3,721,525</td>\n", + " <td>3,678,732</td>\n", + " <td>3,634,488</td>\n", + " <td>3,593,077</td>\n", + " <td>3,534,874</td>\n", + " <td>3,473,232</td>\n", + " <td>3,406,672</td>\n", + " <td>3,325,286</td>\n", + " <td>3,193,354</td>\n", + " <td>3,193,694</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>\n", + " <div class=\"colab-df-buttons\">\n", + "\n", + " <div class=\"colab-df-container\">\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-dccb6b9c-bd3e-4959-ab64-fe4534c0c405')\"\n", + " title=\"Convert this dataframe to an interactive table.\"\n", + " style=\"display:none;\">\n", + "\n", + " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", + " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", + " </svg>\n", + " </button>\n", + "\n", + " <style>\n", + " .colab-df-container {\n", + " display:flex;\n", + " gap: 12px;\n", + " }\n", + "\n", + " .colab-df-convert {\n", + " background-color: #E8F0FE;\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: #1967D2;\n", + " height: 32px;\n", + " padding: 0 0 0 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-convert:hover {\n", + " background-color: #E2EBFA;\n", + " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: #174EA6;\n", + " }\n", + "\n", + " .colab-df-buttons div {\n", + " margin-bottom: 4px;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert {\n", + " background-color: #3B4455;\n", + " fill: #D2E3FC;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert:hover {\n", + " background-color: #434B5C;\n", + " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", + " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", + " fill: #FFFFFF;\n", + " }\n", + " </style>\n", + "\n", + " <script>\n", + " const buttonEl =\n", + " document.querySelector('#df-dccb6b9c-bd3e-4959-ab64-fe4534c0c405 button.colab-df-convert');\n", + " buttonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + "\n", + " async function convertToInteractive(key) {\n", + " const element = document.querySelector('#df-dccb6b9c-bd3e-4959-ab64-fe4534c0c405');\n", + " const dataTable =\n", + " await google.colab.kernel.invokeFunction('convertToInteractive',\n", + " [key], {});\n", + " if (!dataTable) return;\n", + "\n", + " const docLinkHtml = 'Like what you see? Visit the ' +\n", + " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", + " + ' to learn more about interactive tables.';\n", + " element.innerHTML = '';\n", + " dataTable['output_type'] = 'display_data';\n", + " await google.colab.output.renderOutput(dataTable, element);\n", + " const docLink = document.createElement('div');\n", + " docLink.innerHTML = docLinkHtml;\n", + " element.appendChild(docLink);\n", + " }\n", + " </script>\n", + " </div>\n", + "\n", + "\n", + "<div id=\"df-3877c2c4-710c-4fd7-ac68-35db886c3a32\">\n", + " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-3877c2c4-710c-4fd7-ac68-35db886c3a32')\"\n", + " title=\"Suggest charts\"\n", + " style=\"display:none;\">\n", + "\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", + " width=\"24px\">\n", + " <g>\n", + " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", + " </g>\n", + "</svg>\n", + " </button>\n", + "\n", + "<style>\n", + " .colab-df-quickchart {\n", + " --bg-color: #E8F0FE;\n", + " --fill-color: #1967D2;\n", + " --hover-bg-color: #E2EBFA;\n", + " --hover-fill-color: #174EA6;\n", + " --disabled-fill-color: #AAA;\n", + " --disabled-bg-color: #DDD;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-quickchart {\n", + " --bg-color: #3B4455;\n", + " --fill-color: #D2E3FC;\n", + " --hover-bg-color: #434B5C;\n", + " --hover-fill-color: #FFFFFF;\n", + " --disabled-bg-color: #3B4455;\n", + " --disabled-fill-color: #666;\n", + " }\n", + "\n", + " .colab-df-quickchart {\n", + " background-color: var(--bg-color);\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: var(--fill-color);\n", + " height: 32px;\n", + " padding: 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-quickchart:hover {\n", + " background-color: var(--hover-bg-color);\n", + " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: var(--button-hover-fill-color);\n", + " }\n", + "\n", + " .colab-df-quickchart-complete:disabled,\n", + " .colab-df-quickchart-complete:disabled:hover {\n", + " background-color: var(--disabled-bg-color);\n", + " fill: var(--disabled-fill-color);\n", + " box-shadow: none;\n", + " }\n", + "\n", + " .colab-df-spinner {\n", + " border: 2px solid var(--fill-color);\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " animation:\n", + " spin 1s steps(1) infinite;\n", + " }\n", + "\n", + " @keyframes spin {\n", + " 0% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " border-left-color: var(--fill-color);\n", + " }\n", + " 20% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 30% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 40% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 60% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 80% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " 90% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " }\n", + "</style>\n", + "\n", + " <script>\n", + " async function quickchart(key) {\n", + " const quickchartButtonEl =\n", + " document.querySelector('#' + key + ' button');\n", + " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", + " quickchartButtonEl.classList.add('colab-df-spinner');\n", + " try {\n", + " const charts = await google.colab.kernel.invokeFunction(\n", + " 'suggestCharts', [key], {});\n", + " } catch (error) {\n", + " console.error('Error during call to suggestCharts:', error);\n", + " }\n", + " quickchartButtonEl.classList.remove('colab-df-spinner');\n", + " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", + " }\n", + " (() => {\n", + " let quickchartButtonEl =\n", + " document.querySelector('#df-3877c2c4-710c-4fd7-ac68-35db886c3a32 button');\n", + " quickchartButtonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + " })();\n", + " </script>\n", + "</div>\n", + " </div>\n", + " </div>\n" + ] + }, + "metadata": {}, + "execution_count": 4 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Save data to CSV\n", + "df.to_csv('us-population-2010-2019-states-code.csv', index=False)" + ], + "metadata": { + "id": "91aS3EKCn6Hv" + }, + "execution_count": 5, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Data pre-processing" + ], + "metadata": { + "id": "ljlic4GgsbCr" + } + }, + { + "cell_type": "code", + "source": [ + "# Reshape the DataFrame\n", + "df_reshaped = pd.melt(df, id_vars=['states', 'states_code', 'id'], var_name='year', value_name='population')\n", + "\n", + "# Convert 'year' column values to integers\n", + "df_reshaped['states'] = df_reshaped['states'].astype(str)\n", + "df_reshaped['year'] = df_reshaped['year'].astype(int)\n", + "df_reshaped['population'] = df_reshaped['population'].str.replace(',', '').astype(int)\n", + "\n", + "df_reshaped" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 424 + }, + "id": "SgaksqEUJPnt", + "outputId": "9f24f21e-508e-4f12-eb0d-04169af84b7e" + }, + "execution_count": 6, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " states states_code id year population\n", + "0 Alabama AL 1 2010 4785437\n", + "1 Alaska AK 2 2010 713910\n", + "2 Arizona AZ 4 2010 6407172\n", + "3 Arkansas AR 5 2010 2921964\n", + "4 California CA 6 2010 37319502\n", + ".. ... ... .. ... ...\n", + "515 Washington WA 53 2019 7614893\n", + "516 West Virginia WV 54 2019 1792147\n", + "517 Wisconsin WI 55 2019 5822434\n", + "518 Wyoming WY 56 2019 578759\n", + "519 Puerto Rico PR 72 2019 3193694\n", + "\n", + "[520 rows x 5 columns]" + ], + "text/html": [ + "\n", + " <div id=\"df-5cd847b6-a913-46b2-a16c-668ca1cf8e12\" class=\"colab-df-container\">\n", + " <div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>states</th>\n", + " <th>states_code</th>\n", + " <th>id</th>\n", + " <th>year</th>\n", + " <th>population</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>Alabama</td>\n", + " <td>AL</td>\n", + " <td>1</td>\n", + " <td>2010</td>\n", + " <td>4785437</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>Alaska</td>\n", + " <td>AK</td>\n", + " <td>2</td>\n", + " <td>2010</td>\n", + " <td>713910</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <td>Arizona</td>\n", + " <td>AZ</td>\n", + " <td>4</td>\n", + " <td>2010</td>\n", + " <td>6407172</td>\n", + " </tr>\n", + " <tr>\n", + " <th>3</th>\n", + " <td>Arkansas</td>\n", + " <td>AR</td>\n", + " <td>5</td>\n", + " <td>2010</td>\n", + " <td>2921964</td>\n", + " </tr>\n", + " <tr>\n", + " <th>4</th>\n", + " <td>California</td>\n", + " <td>CA</td>\n", + " <td>6</td>\n", + " <td>2010</td>\n", + " <td>37319502</td>\n", + " </tr>\n", + " <tr>\n", + " <th>...</th>\n", + " <td>...</td>\n", + " <td>...</td>\n", + " <td>...</td>\n", + " <td>...</td>\n", + " <td>...</td>\n", + " </tr>\n", + " <tr>\n", + " <th>515</th>\n", + " <td>Washington</td>\n", + " <td>WA</td>\n", + " <td>53</td>\n", + " <td>2019</td>\n", + " <td>7614893</td>\n", + " </tr>\n", + " <tr>\n", + " <th>516</th>\n", + " <td>West Virginia</td>\n", + " <td>WV</td>\n", + " <td>54</td>\n", + " <td>2019</td>\n", + " <td>1792147</td>\n", + " </tr>\n", + " <tr>\n", + " <th>517</th>\n", + " <td>Wisconsin</td>\n", + " <td>WI</td>\n", + " <td>55</td>\n", + " <td>2019</td>\n", + " <td>5822434</td>\n", + " </tr>\n", + " <tr>\n", + " <th>518</th>\n", + " <td>Wyoming</td>\n", + " <td>WY</td>\n", + " <td>56</td>\n", + " <td>2019</td>\n", + " <td>578759</td>\n", + " </tr>\n", + " <tr>\n", + " <th>519</th>\n", + " <td>Puerto Rico</td>\n", + " <td>PR</td>\n", + " <td>72</td>\n", + " <td>2019</td>\n", + " <td>3193694</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "<p>520 rows × 5 columns</p>\n", + "</div>\n", + " <div class=\"colab-df-buttons\">\n", + "\n", + " <div class=\"colab-df-container\">\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-5cd847b6-a913-46b2-a16c-668ca1cf8e12')\"\n", + " title=\"Convert this dataframe to an interactive table.\"\n", + " style=\"display:none;\">\n", + "\n", + " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", + " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", + " </svg>\n", + " </button>\n", + "\n", + " <style>\n", + " .colab-df-container {\n", + " display:flex;\n", + " gap: 12px;\n", + " }\n", + "\n", + " .colab-df-convert {\n", + " background-color: #E8F0FE;\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: #1967D2;\n", + " height: 32px;\n", + " padding: 0 0 0 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-convert:hover {\n", + " background-color: #E2EBFA;\n", + " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: #174EA6;\n", + " }\n", + "\n", + " .colab-df-buttons div {\n", + " margin-bottom: 4px;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert {\n", + " background-color: #3B4455;\n", + " fill: #D2E3FC;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert:hover {\n", + " background-color: #434B5C;\n", + " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", + " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", + " fill: #FFFFFF;\n", + " }\n", + " </style>\n", + "\n", + " <script>\n", + " const buttonEl =\n", + " document.querySelector('#df-5cd847b6-a913-46b2-a16c-668ca1cf8e12 button.colab-df-convert');\n", + " buttonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + "\n", + " async function convertToInteractive(key) {\n", + " const element = document.querySelector('#df-5cd847b6-a913-46b2-a16c-668ca1cf8e12');\n", + " const dataTable =\n", + " await google.colab.kernel.invokeFunction('convertToInteractive',\n", + " [key], {});\n", + " if (!dataTable) return;\n", + "\n", + " const docLinkHtml = 'Like what you see? Visit the ' +\n", + " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", + " + ' to learn more about interactive tables.';\n", + " element.innerHTML = '';\n", + " dataTable['output_type'] = 'display_data';\n", + " await google.colab.output.renderOutput(dataTable, element);\n", + " const docLink = document.createElement('div');\n", + " docLink.innerHTML = docLinkHtml;\n", + " element.appendChild(docLink);\n", + " }\n", + " </script>\n", + " </div>\n", + "\n", + "\n", + "<div id=\"df-22cb622d-3c8b-41e5-8254-01b6cf0fcc20\">\n", + " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-22cb622d-3c8b-41e5-8254-01b6cf0fcc20')\"\n", + " title=\"Suggest charts\"\n", + " style=\"display:none;\">\n", + "\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", + " width=\"24px\">\n", + " <g>\n", + " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", + " </g>\n", + "</svg>\n", + " </button>\n", + "\n", + "<style>\n", + " .colab-df-quickchart {\n", + " --bg-color: #E8F0FE;\n", + " --fill-color: #1967D2;\n", + " --hover-bg-color: #E2EBFA;\n", + " --hover-fill-color: #174EA6;\n", + " --disabled-fill-color: #AAA;\n", + " --disabled-bg-color: #DDD;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-quickchart {\n", + " --bg-color: #3B4455;\n", + " --fill-color: #D2E3FC;\n", + " --hover-bg-color: #434B5C;\n", + " --hover-fill-color: #FFFFFF;\n", + " --disabled-bg-color: #3B4455;\n", + " --disabled-fill-color: #666;\n", + " }\n", + "\n", + " .colab-df-quickchart {\n", + " background-color: var(--bg-color);\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: var(--fill-color);\n", + " height: 32px;\n", + " padding: 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-quickchart:hover {\n", + " background-color: var(--hover-bg-color);\n", + " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: var(--button-hover-fill-color);\n", + " }\n", + "\n", + " .colab-df-quickchart-complete:disabled,\n", + " .colab-df-quickchart-complete:disabled:hover {\n", + " background-color: var(--disabled-bg-color);\n", + " fill: var(--disabled-fill-color);\n", + " box-shadow: none;\n", + " }\n", + "\n", + " .colab-df-spinner {\n", + " border: 2px solid var(--fill-color);\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " animation:\n", + " spin 1s steps(1) infinite;\n", + " }\n", + "\n", + " @keyframes spin {\n", + " 0% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " border-left-color: var(--fill-color);\n", + " }\n", + " 20% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 30% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 40% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 60% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 80% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " 90% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " }\n", + "</style>\n", + "\n", + " <script>\n", + " async function quickchart(key) {\n", + " const quickchartButtonEl =\n", + " document.querySelector('#' + key + ' button');\n", + " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", + " quickchartButtonEl.classList.add('colab-df-spinner');\n", + " try {\n", + " const charts = await google.colab.kernel.invokeFunction(\n", + " 'suggestCharts', [key], {});\n", + " } catch (error) {\n", + " console.error('Error during call to suggestCharts:', error);\n", + " }\n", + " quickchartButtonEl.classList.remove('colab-df-spinner');\n", + " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", + " }\n", + " (() => {\n", + " let quickchartButtonEl =\n", + " document.querySelector('#df-22cb622d-3c8b-41e5-8254-01b6cf0fcc20 button');\n", + " quickchartButtonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + " })();\n", + " </script>\n", + "</div>\n", + " </div>\n", + " </div>\n" + ] + }, + "metadata": {}, + "execution_count": 6 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Save reshaped data to CSV\n", + "df_reshaped.to_csv('us-population-2010-2019-reshaped.csv')" + ], + "metadata": { + "id": "CGrKAcOs4aUn" + }, + "execution_count": 7, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "# Subset dataframe by year\n", + "selected_year = 2019\n", + "df_selected_year = df_reshaped[df_reshaped.year == selected_year]\n", + "df_selected_year" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "VsIFh2VE4JTd", + "outputId": "32fd0075-a695-42d3-b593-d5dc9ec4f7f8" + }, + "execution_count": 8, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " states states_code id year population\n", + "468 Alabama AL 1 2019 4903185\n", + "469 Alaska AK 2 2019 731545\n", + "470 Arizona AZ 4 2019 7278717\n", + "471 Arkansas AR 5 2019 3017804\n", + "472 California CA 6 2019 39512223\n", + "473 Colorado CO 8 2019 5758736\n", + "474 Connecticut CT 9 2019 3565287\n", + "475 Delaware DE 10 2019 973764\n", + "476 District of Columbia DC 11 2019 705749\n", + "477 Florida FL 12 2019 21477737\n", + "478 Georgia GA 13 2019 10617423\n", + "479 Hawaii HI 15 2019 1415872\n", + "480 Idaho ID 16 2019 1787065\n", + "481 Illinois IL 17 2019 12671821\n", + "482 Indiana IN 18 2019 6732219\n", + "483 Iowa IA 19 2019 3155070\n", + "484 Kansas KS 20 2019 2913314\n", + "485 Kentucky KY 21 2019 4467673\n", + "486 Louisiana LA 22 2019 4648794\n", + "487 Maine ME 23 2019 1344212\n", + "488 Maryland MD 24 2019 6045680\n", + "489 Massachusetts MA 25 2019 6892503\n", + "490 Michigan MI 26 2019 9986857\n", + "491 Minnesota MN 27 2019 5639632\n", + "492 Mississippi MS 28 2019 2976149\n", + "493 Missouri MO 29 2019 6137428\n", + "494 Montana MT 30 2019 1068778\n", + "495 Nebraska NE 31 2019 1934408\n", + "496 Nevada NV 32 2019 3080156\n", + "497 New Hampshire NH 33 2019 1359711\n", + "498 New Jersey NJ 34 2019 8882190\n", + "499 New Mexico NM 35 2019 2096829\n", + "500 New York NY 36 2019 19453561\n", + "501 North Carolina NC 37 2019 10488084\n", + "502 North Dakota ND 38 2019 762062\n", + "503 Ohio OH 39 2019 11689100\n", + "504 Oklahoma OK 40 2019 3956971\n", + "505 Oregon OR 41 2019 4217737\n", + "506 Pennsylvania PA 42 2019 12801989\n", + "507 Rhode Island RI 44 2019 1059361\n", + "508 South Carolina SC 45 2019 5148714\n", + "509 South Dakota SD 46 2019 884659\n", + "510 Tennessee TN 47 2019 6829174\n", + "511 Texas TX 48 2019 28995881\n", + "512 Utah UT 49 2019 3205958\n", + "513 Vermont VT 50 2019 623989\n", + "514 Virginia VA 51 2019 8535519\n", + "515 Washington WA 53 2019 7614893\n", + "516 West Virginia WV 54 2019 1792147\n", + "517 Wisconsin WI 55 2019 5822434\n", + "518 Wyoming WY 56 2019 578759\n", + "519 Puerto Rico PR 72 2019 3193694" + ], + "text/html": [ + "\n", + " <div id=\"df-e1b8d394-1033-4547-abed-2e7b44c7645b\" class=\"colab-df-container\">\n", + " <div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>states</th>\n", + " <th>states_code</th>\n", + " <th>id</th>\n", + " <th>year</th>\n", + " <th>population</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>468</th>\n", + " <td>Alabama</td>\n", + " <td>AL</td>\n", + " <td>1</td>\n", + " <td>2019</td>\n", + " <td>4903185</td>\n", + " </tr>\n", + " <tr>\n", + " <th>469</th>\n", + " <td>Alaska</td>\n", + " <td>AK</td>\n", + " <td>2</td>\n", + " <td>2019</td>\n", + " <td>731545</td>\n", + " </tr>\n", + " <tr>\n", + " <th>470</th>\n", + " <td>Arizona</td>\n", + " <td>AZ</td>\n", + " <td>4</td>\n", + " <td>2019</td>\n", + " <td>7278717</td>\n", + " </tr>\n", + " <tr>\n", + " <th>471</th>\n", + " <td>Arkansas</td>\n", + " <td>AR</td>\n", + " <td>5</td>\n", + " <td>2019</td>\n", + " <td>3017804</td>\n", + " </tr>\n", + " <tr>\n", + " <th>472</th>\n", + " <td>California</td>\n", + " <td>CA</td>\n", + " <td>6</td>\n", + " <td>2019</td>\n", + " <td>39512223</td>\n", + " </tr>\n", + " <tr>\n", + " <th>473</th>\n", + " <td>Colorado</td>\n", + " <td>CO</td>\n", + " <td>8</td>\n", + " <td>2019</td>\n", + " <td>5758736</td>\n", + " </tr>\n", + " <tr>\n", + " <th>474</th>\n", + " <td>Connecticut</td>\n", + " <td>CT</td>\n", + " <td>9</td>\n", + " <td>2019</td>\n", + " <td>3565287</td>\n", + " </tr>\n", + " <tr>\n", + " <th>475</th>\n", + " <td>Delaware</td>\n", + " <td>DE</td>\n", + " <td>10</td>\n", + " <td>2019</td>\n", + " <td>973764</td>\n", + " </tr>\n", + " <tr>\n", + " <th>476</th>\n", + " <td>District of Columbia</td>\n", + " <td>DC</td>\n", + " <td>11</td>\n", + " <td>2019</td>\n", + " <td>705749</td>\n", + " </tr>\n", + " <tr>\n", + " <th>477</th>\n", + " <td>Florida</td>\n", + " <td>FL</td>\n", + " <td>12</td>\n", + " <td>2019</td>\n", + " <td>21477737</td>\n", + " </tr>\n", + " <tr>\n", + " <th>478</th>\n", + " <td>Georgia</td>\n", + " <td>GA</td>\n", + " <td>13</td>\n", + " <td>2019</td>\n", + " <td>10617423</td>\n", + " </tr>\n", + " <tr>\n", + " <th>479</th>\n", + " <td>Hawaii</td>\n", + " <td>HI</td>\n", + " <td>15</td>\n", + " <td>2019</td>\n", + " <td>1415872</td>\n", + " </tr>\n", + " <tr>\n", + " <th>480</th>\n", + " <td>Idaho</td>\n", + " <td>ID</td>\n", + " <td>16</td>\n", + " <td>2019</td>\n", + " <td>1787065</td>\n", + " </tr>\n", + " <tr>\n", + " <th>481</th>\n", + " <td>Illinois</td>\n", + " <td>IL</td>\n", + " <td>17</td>\n", + " <td>2019</td>\n", + " <td>12671821</td>\n", + " </tr>\n", + " <tr>\n", + " <th>482</th>\n", + " <td>Indiana</td>\n", + " <td>IN</td>\n", + " <td>18</td>\n", + " <td>2019</td>\n", + " <td>6732219</td>\n", + " </tr>\n", + " <tr>\n", + " <th>483</th>\n", + " <td>Iowa</td>\n", + " <td>IA</td>\n", + " <td>19</td>\n", + " <td>2019</td>\n", + " <td>3155070</td>\n", + " </tr>\n", + " <tr>\n", + " <th>484</th>\n", + " <td>Kansas</td>\n", + " <td>KS</td>\n", + " <td>20</td>\n", + " <td>2019</td>\n", + " <td>2913314</td>\n", + " </tr>\n", + " <tr>\n", + " <th>485</th>\n", + " <td>Kentucky</td>\n", + " <td>KY</td>\n", + " <td>21</td>\n", + " <td>2019</td>\n", + " <td>4467673</td>\n", + " </tr>\n", + " <tr>\n", + " <th>486</th>\n", + " <td>Louisiana</td>\n", + " <td>LA</td>\n", + " <td>22</td>\n", + " <td>2019</td>\n", + " <td>4648794</td>\n", + " </tr>\n", + " <tr>\n", + " <th>487</th>\n", + " <td>Maine</td>\n", + " <td>ME</td>\n", + " <td>23</td>\n", + " <td>2019</td>\n", + " <td>1344212</td>\n", + " </tr>\n", + " <tr>\n", + " <th>488</th>\n", + " <td>Maryland</td>\n", + " <td>MD</td>\n", + " <td>24</td>\n", + " <td>2019</td>\n", + " <td>6045680</td>\n", + " </tr>\n", + " <tr>\n", + " <th>489</th>\n", + " <td>Massachusetts</td>\n", + " <td>MA</td>\n", + " <td>25</td>\n", + " <td>2019</td>\n", + " <td>6892503</td>\n", + " </tr>\n", + " <tr>\n", + " <th>490</th>\n", + " <td>Michigan</td>\n", + " <td>MI</td>\n", + " <td>26</td>\n", + " <td>2019</td>\n", + " <td>9986857</td>\n", + " </tr>\n", + " <tr>\n", + " <th>491</th>\n", + " <td>Minnesota</td>\n", + " <td>MN</td>\n", + " <td>27</td>\n", + " <td>2019</td>\n", + " <td>5639632</td>\n", + " </tr>\n", + " <tr>\n", + " <th>492</th>\n", + " <td>Mississippi</td>\n", + " <td>MS</td>\n", + " <td>28</td>\n", + " <td>2019</td>\n", + " <td>2976149</td>\n", + " </tr>\n", + " <tr>\n", + " <th>493</th>\n", + " <td>Missouri</td>\n", + " <td>MO</td>\n", + " <td>29</td>\n", + " <td>2019</td>\n", + " <td>6137428</td>\n", + " </tr>\n", + " <tr>\n", + " <th>494</th>\n", + " <td>Montana</td>\n", + " <td>MT</td>\n", + " <td>30</td>\n", + " <td>2019</td>\n", + " <td>1068778</td>\n", + " </tr>\n", + " <tr>\n", + " <th>495</th>\n", + " <td>Nebraska</td>\n", + " <td>NE</td>\n", + " <td>31</td>\n", + " <td>2019</td>\n", + " <td>1934408</td>\n", + " </tr>\n", + " <tr>\n", + " <th>496</th>\n", + " <td>Nevada</td>\n", + " <td>NV</td>\n", + " <td>32</td>\n", + " <td>2019</td>\n", + " <td>3080156</td>\n", + " </tr>\n", + " <tr>\n", + " <th>497</th>\n", + " <td>New Hampshire</td>\n", + " <td>NH</td>\n", + " <td>33</td>\n", + " <td>2019</td>\n", + " <td>1359711</td>\n", + " </tr>\n", + " <tr>\n", + " <th>498</th>\n", + " <td>New Jersey</td>\n", + " <td>NJ</td>\n", + " <td>34</td>\n", + " <td>2019</td>\n", + " <td>8882190</td>\n", + " </tr>\n", + " <tr>\n", + " <th>499</th>\n", + " <td>New Mexico</td>\n", + " <td>NM</td>\n", + " <td>35</td>\n", + " <td>2019</td>\n", + " <td>2096829</td>\n", + " </tr>\n", + " <tr>\n", + " <th>500</th>\n", + " <td>New York</td>\n", + " <td>NY</td>\n", + " <td>36</td>\n", + " <td>2019</td>\n", + " <td>19453561</td>\n", + " </tr>\n", + " <tr>\n", + " <th>501</th>\n", + " <td>North Carolina</td>\n", + " <td>NC</td>\n", + " <td>37</td>\n", + " <td>2019</td>\n", + " <td>10488084</td>\n", + " </tr>\n", + " <tr>\n", + " <th>502</th>\n", + " <td>North Dakota</td>\n", + " <td>ND</td>\n", + " <td>38</td>\n", + " <td>2019</td>\n", + " <td>762062</td>\n", + " </tr>\n", + " <tr>\n", + " <th>503</th>\n", + " <td>Ohio</td>\n", + " <td>OH</td>\n", + " <td>39</td>\n", + " <td>2019</td>\n", + " <td>11689100</td>\n", + " </tr>\n", + " <tr>\n", + " <th>504</th>\n", + " <td>Oklahoma</td>\n", + " <td>OK</td>\n", + " <td>40</td>\n", + " <td>2019</td>\n", + " <td>3956971</td>\n", + " </tr>\n", + " <tr>\n", + " <th>505</th>\n", + " <td>Oregon</td>\n", + " <td>OR</td>\n", + " <td>41</td>\n", + " <td>2019</td>\n", + " <td>4217737</td>\n", + " </tr>\n", + " <tr>\n", + " <th>506</th>\n", + " <td>Pennsylvania</td>\n", + " <td>PA</td>\n", + " <td>42</td>\n", + " <td>2019</td>\n", + " <td>12801989</td>\n", + " </tr>\n", + " <tr>\n", + " <th>507</th>\n", + " <td>Rhode Island</td>\n", + " <td>RI</td>\n", + " <td>44</td>\n", + " <td>2019</td>\n", + " <td>1059361</td>\n", + " </tr>\n", + " <tr>\n", + " <th>508</th>\n", + " <td>South Carolina</td>\n", + " <td>SC</td>\n", + " <td>45</td>\n", + " <td>2019</td>\n", + " <td>5148714</td>\n", + " </tr>\n", + " <tr>\n", + " <th>509</th>\n", + " <td>South Dakota</td>\n", + " <td>SD</td>\n", + " <td>46</td>\n", + " <td>2019</td>\n", + " <td>884659</td>\n", + " </tr>\n", + " <tr>\n", + " <th>510</th>\n", + " <td>Tennessee</td>\n", + " <td>TN</td>\n", + " <td>47</td>\n", + " <td>2019</td>\n", + " <td>6829174</td>\n", + " </tr>\n", + " <tr>\n", + " <th>511</th>\n", + " <td>Texas</td>\n", + " <td>TX</td>\n", + " <td>48</td>\n", + " <td>2019</td>\n", + " <td>28995881</td>\n", + " </tr>\n", + " <tr>\n", + " <th>512</th>\n", + " <td>Utah</td>\n", + " <td>UT</td>\n", + " <td>49</td>\n", + " <td>2019</td>\n", + " <td>3205958</td>\n", + " </tr>\n", + " <tr>\n", + " <th>513</th>\n", + " <td>Vermont</td>\n", + " <td>VT</td>\n", + " <td>50</td>\n", + " <td>2019</td>\n", + " <td>623989</td>\n", + " </tr>\n", + " <tr>\n", + " <th>514</th>\n", + " <td>Virginia</td>\n", + " <td>VA</td>\n", + " <td>51</td>\n", + " <td>2019</td>\n", + " <td>8535519</td>\n", + " </tr>\n", + " <tr>\n", + " <th>515</th>\n", + " <td>Washington</td>\n", + " <td>WA</td>\n", + " <td>53</td>\n", + " <td>2019</td>\n", + " <td>7614893</td>\n", + " </tr>\n", + " <tr>\n", + " <th>516</th>\n", + " <td>West Virginia</td>\n", + " <td>WV</td>\n", + " <td>54</td>\n", + " <td>2019</td>\n", + " <td>1792147</td>\n", + " </tr>\n", + " <tr>\n", + " <th>517</th>\n", + " <td>Wisconsin</td>\n", + " <td>WI</td>\n", + " <td>55</td>\n", + " <td>2019</td>\n", + " <td>5822434</td>\n", + " </tr>\n", + " <tr>\n", + " <th>518</th>\n", + " <td>Wyoming</td>\n", + " <td>WY</td>\n", + " <td>56</td>\n", + " <td>2019</td>\n", + " <td>578759</td>\n", + " </tr>\n", + " <tr>\n", + " <th>519</th>\n", + " <td>Puerto Rico</td>\n", + " <td>PR</td>\n", + " <td>72</td>\n", + " <td>2019</td>\n", + " <td>3193694</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>\n", + " <div class=\"colab-df-buttons\">\n", + "\n", + " <div class=\"colab-df-container\">\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-e1b8d394-1033-4547-abed-2e7b44c7645b')\"\n", + " title=\"Convert this dataframe to an interactive table.\"\n", + " style=\"display:none;\">\n", + "\n", + " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", + " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", + " </svg>\n", + " </button>\n", + "\n", + " <style>\n", + " .colab-df-container {\n", + " display:flex;\n", + " gap: 12px;\n", + " }\n", + "\n", + " .colab-df-convert {\n", + " background-color: #E8F0FE;\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: #1967D2;\n", + " height: 32px;\n", + " padding: 0 0 0 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-convert:hover {\n", + " background-color: #E2EBFA;\n", + " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: #174EA6;\n", + " }\n", + "\n", + " .colab-df-buttons div {\n", + " margin-bottom: 4px;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert {\n", + " background-color: #3B4455;\n", + " fill: #D2E3FC;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert:hover {\n", + " background-color: #434B5C;\n", + " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", + " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", + " fill: #FFFFFF;\n", + " }\n", + " </style>\n", + "\n", + " <script>\n", + " const buttonEl =\n", + " document.querySelector('#df-e1b8d394-1033-4547-abed-2e7b44c7645b button.colab-df-convert');\n", + " buttonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + "\n", + " async function convertToInteractive(key) {\n", + " const element = document.querySelector('#df-e1b8d394-1033-4547-abed-2e7b44c7645b');\n", + " const dataTable =\n", + " await google.colab.kernel.invokeFunction('convertToInteractive',\n", + " [key], {});\n", + " if (!dataTable) return;\n", + "\n", + " const docLinkHtml = 'Like what you see? Visit the ' +\n", + " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", + " + ' to learn more about interactive tables.';\n", + " element.innerHTML = '';\n", + " dataTable['output_type'] = 'display_data';\n", + " await google.colab.output.renderOutput(dataTable, element);\n", + " const docLink = document.createElement('div');\n", + " docLink.innerHTML = docLinkHtml;\n", + " element.appendChild(docLink);\n", + " }\n", + " </script>\n", + " </div>\n", + "\n", + "\n", + "<div id=\"df-588c2136-603c-4b1e-82c9-46f26aa38ab8\">\n", + " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-588c2136-603c-4b1e-82c9-46f26aa38ab8')\"\n", + " title=\"Suggest charts\"\n", + " style=\"display:none;\">\n", + "\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", + " width=\"24px\">\n", + " <g>\n", + " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", + " </g>\n", + "</svg>\n", + " </button>\n", + "\n", + "<style>\n", + " .colab-df-quickchart {\n", + " --bg-color: #E8F0FE;\n", + " --fill-color: #1967D2;\n", + " --hover-bg-color: #E2EBFA;\n", + " --hover-fill-color: #174EA6;\n", + " --disabled-fill-color: #AAA;\n", + " --disabled-bg-color: #DDD;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-quickchart {\n", + " --bg-color: #3B4455;\n", + " --fill-color: #D2E3FC;\n", + " --hover-bg-color: #434B5C;\n", + " --hover-fill-color: #FFFFFF;\n", + " --disabled-bg-color: #3B4455;\n", + " --disabled-fill-color: #666;\n", + " }\n", + "\n", + " .colab-df-quickchart {\n", + " background-color: var(--bg-color);\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: var(--fill-color);\n", + " height: 32px;\n", + " padding: 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-quickchart:hover {\n", + " background-color: var(--hover-bg-color);\n", + " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: var(--button-hover-fill-color);\n", + " }\n", + "\n", + " .colab-df-quickchart-complete:disabled,\n", + " .colab-df-quickchart-complete:disabled:hover {\n", + " background-color: var(--disabled-bg-color);\n", + " fill: var(--disabled-fill-color);\n", + " box-shadow: none;\n", + " }\n", + "\n", + " .colab-df-spinner {\n", + " border: 2px solid var(--fill-color);\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " animation:\n", + " spin 1s steps(1) infinite;\n", + " }\n", + "\n", + " @keyframes spin {\n", + " 0% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " border-left-color: var(--fill-color);\n", + " }\n", + " 20% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 30% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 40% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 60% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 80% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " 90% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " }\n", + "</style>\n", + "\n", + " <script>\n", + " async function quickchart(key) {\n", + " const quickchartButtonEl =\n", + " document.querySelector('#' + key + ' button');\n", + " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", + " quickchartButtonEl.classList.add('colab-df-spinner');\n", + " try {\n", + " const charts = await google.colab.kernel.invokeFunction(\n", + " 'suggestCharts', [key], {});\n", + " } catch (error) {\n", + " console.error('Error during call to suggestCharts:', error);\n", + " }\n", + " quickchartButtonEl.classList.remove('colab-df-spinner');\n", + " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", + " }\n", + " (() => {\n", + " let quickchartButtonEl =\n", + " document.querySelector('#df-588c2136-603c-4b1e-82c9-46f26aa38ab8 button');\n", + " quickchartButtonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + " })();\n", + " </script>\n", + "</div>\n", + " </div>\n", + " </div>\n" + ] + }, + "metadata": {}, + "execution_count": 8 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Sort by year\n", + "df_selected_year_sorted = df_selected_year.sort_values(by=\"population\", ascending=False)\n", + "df_selected_year_sorted" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "nH6XuCxFkVWV", + "outputId": "06465a75-f45c-47bb-f26c-4a4c8152c69b" + }, + "execution_count": 9, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " states states_code id year population\n", + "472 California CA 6 2019 39512223\n", + "511 Texas TX 48 2019 28995881\n", + "477 Florida FL 12 2019 21477737\n", + "500 New York NY 36 2019 19453561\n", + "506 Pennsylvania PA 42 2019 12801989\n", + "481 Illinois IL 17 2019 12671821\n", + "503 Ohio OH 39 2019 11689100\n", + "478 Georgia GA 13 2019 10617423\n", + "501 North Carolina NC 37 2019 10488084\n", + "490 Michigan MI 26 2019 9986857\n", + "498 New Jersey NJ 34 2019 8882190\n", + "514 Virginia VA 51 2019 8535519\n", + "515 Washington WA 53 2019 7614893\n", + "470 Arizona AZ 4 2019 7278717\n", + "489 Massachusetts MA 25 2019 6892503\n", + "510 Tennessee TN 47 2019 6829174\n", + "482 Indiana IN 18 2019 6732219\n", + "493 Missouri MO 29 2019 6137428\n", + "488 Maryland MD 24 2019 6045680\n", + "517 Wisconsin WI 55 2019 5822434\n", + "473 Colorado CO 8 2019 5758736\n", + "491 Minnesota MN 27 2019 5639632\n", + "508 South Carolina SC 45 2019 5148714\n", + "468 Alabama AL 1 2019 4903185\n", + "486 Louisiana LA 22 2019 4648794\n", + "485 Kentucky KY 21 2019 4467673\n", + "505 Oregon OR 41 2019 4217737\n", + "504 Oklahoma OK 40 2019 3956971\n", + "474 Connecticut CT 9 2019 3565287\n", + "512 Utah UT 49 2019 3205958\n", + "519 Puerto Rico PR 72 2019 3193694\n", + "483 Iowa IA 19 2019 3155070\n", + "496 Nevada NV 32 2019 3080156\n", + "471 Arkansas AR 5 2019 3017804\n", + "492 Mississippi MS 28 2019 2976149\n", + "484 Kansas KS 20 2019 2913314\n", + "499 New Mexico NM 35 2019 2096829\n", + "495 Nebraska NE 31 2019 1934408\n", + "516 West Virginia WV 54 2019 1792147\n", + "480 Idaho ID 16 2019 1787065\n", + "479 Hawaii HI 15 2019 1415872\n", + "497 New Hampshire NH 33 2019 1359711\n", + "487 Maine ME 23 2019 1344212\n", + "494 Montana MT 30 2019 1068778\n", + "507 Rhode Island RI 44 2019 1059361\n", + "475 Delaware DE 10 2019 973764\n", + "509 South Dakota SD 46 2019 884659\n", + "502 North Dakota ND 38 2019 762062\n", + "469 Alaska AK 2 2019 731545\n", + "476 District of Columbia DC 11 2019 705749\n", + "513 Vermont VT 50 2019 623989\n", + "518 Wyoming WY 56 2019 578759" + ], + "text/html": [ + "\n", + " <div id=\"df-823679c4-6265-489f-9458-deb15c36ff54\" class=\"colab-df-container\">\n", + " <div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>states</th>\n", + " <th>states_code</th>\n", + " <th>id</th>\n", + " <th>year</th>\n", + " <th>population</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>472</th>\n", + " <td>California</td>\n", + " <td>CA</td>\n", + " <td>6</td>\n", + " <td>2019</td>\n", + " <td>39512223</td>\n", + " </tr>\n", + " <tr>\n", + " <th>511</th>\n", + " <td>Texas</td>\n", + " <td>TX</td>\n", + " <td>48</td>\n", + " <td>2019</td>\n", + " <td>28995881</td>\n", + " </tr>\n", + " <tr>\n", + " <th>477</th>\n", + " <td>Florida</td>\n", + " <td>FL</td>\n", + " <td>12</td>\n", + " <td>2019</td>\n", + " <td>21477737</td>\n", + " </tr>\n", + " <tr>\n", + " <th>500</th>\n", + " <td>New York</td>\n", + " <td>NY</td>\n", + " <td>36</td>\n", + " <td>2019</td>\n", + " <td>19453561</td>\n", + " </tr>\n", + " <tr>\n", + " <th>506</th>\n", + " <td>Pennsylvania</td>\n", + " <td>PA</td>\n", + " <td>42</td>\n", + " <td>2019</td>\n", + " <td>12801989</td>\n", + " </tr>\n", + " <tr>\n", + " <th>481</th>\n", + " <td>Illinois</td>\n", + " <td>IL</td>\n", + " <td>17</td>\n", + " <td>2019</td>\n", + " <td>12671821</td>\n", + " </tr>\n", + " <tr>\n", + " <th>503</th>\n", + " <td>Ohio</td>\n", + " <td>OH</td>\n", + " <td>39</td>\n", + " <td>2019</td>\n", + " <td>11689100</td>\n", + " </tr>\n", + " <tr>\n", + " <th>478</th>\n", + " <td>Georgia</td>\n", + " <td>GA</td>\n", + " <td>13</td>\n", + " <td>2019</td>\n", + " <td>10617423</td>\n", + " </tr>\n", + " <tr>\n", + " <th>501</th>\n", + " <td>North Carolina</td>\n", + " <td>NC</td>\n", + " <td>37</td>\n", + " <td>2019</td>\n", + " <td>10488084</td>\n", + " </tr>\n", + " <tr>\n", + " <th>490</th>\n", + " <td>Michigan</td>\n", + " <td>MI</td>\n", + " <td>26</td>\n", + " <td>2019</td>\n", + " <td>9986857</td>\n", + " </tr>\n", + " <tr>\n", + " <th>498</th>\n", + " <td>New Jersey</td>\n", + " <td>NJ</td>\n", + " <td>34</td>\n", + " <td>2019</td>\n", + " <td>8882190</td>\n", + " </tr>\n", + " <tr>\n", + " <th>514</th>\n", + " <td>Virginia</td>\n", + " <td>VA</td>\n", + " <td>51</td>\n", + " <td>2019</td>\n", + " <td>8535519</td>\n", + " </tr>\n", + " <tr>\n", + " <th>515</th>\n", + " <td>Washington</td>\n", + " <td>WA</td>\n", + " <td>53</td>\n", + " <td>2019</td>\n", + " <td>7614893</td>\n", + " </tr>\n", + " <tr>\n", + " <th>470</th>\n", + " <td>Arizona</td>\n", + " <td>AZ</td>\n", + " <td>4</td>\n", + " <td>2019</td>\n", + " <td>7278717</td>\n", + " </tr>\n", + " <tr>\n", + " <th>489</th>\n", + " <td>Massachusetts</td>\n", + " <td>MA</td>\n", + " <td>25</td>\n", + " <td>2019</td>\n", + " <td>6892503</td>\n", + " </tr>\n", + " <tr>\n", + " <th>510</th>\n", + " <td>Tennessee</td>\n", + " <td>TN</td>\n", + " <td>47</td>\n", + " <td>2019</td>\n", + " <td>6829174</td>\n", + " </tr>\n", + " <tr>\n", + " <th>482</th>\n", + " <td>Indiana</td>\n", + " <td>IN</td>\n", + " <td>18</td>\n", + " <td>2019</td>\n", + " <td>6732219</td>\n", + " </tr>\n", + " <tr>\n", + " <th>493</th>\n", + " <td>Missouri</td>\n", + " <td>MO</td>\n", + " <td>29</td>\n", + " <td>2019</td>\n", + " <td>6137428</td>\n", + " </tr>\n", + " <tr>\n", + " <th>488</th>\n", + " <td>Maryland</td>\n", + " <td>MD</td>\n", + " <td>24</td>\n", + " <td>2019</td>\n", + " <td>6045680</td>\n", + " </tr>\n", + " <tr>\n", + " <th>517</th>\n", + " <td>Wisconsin</td>\n", + " <td>WI</td>\n", + " <td>55</td>\n", + " <td>2019</td>\n", + " <td>5822434</td>\n", + " </tr>\n", + " <tr>\n", + " <th>473</th>\n", + " <td>Colorado</td>\n", + " <td>CO</td>\n", + " <td>8</td>\n", + " <td>2019</td>\n", + " <td>5758736</td>\n", + " </tr>\n", + " <tr>\n", + " <th>491</th>\n", + " <td>Minnesota</td>\n", + " <td>MN</td>\n", + " <td>27</td>\n", + " <td>2019</td>\n", + " <td>5639632</td>\n", + " </tr>\n", + " <tr>\n", + " <th>508</th>\n", + " <td>South Carolina</td>\n", + " <td>SC</td>\n", + " <td>45</td>\n", + " <td>2019</td>\n", + " <td>5148714</td>\n", + " </tr>\n", + " <tr>\n", + " <th>468</th>\n", + " <td>Alabama</td>\n", + " <td>AL</td>\n", + " <td>1</td>\n", + " <td>2019</td>\n", + " <td>4903185</td>\n", + " </tr>\n", + " <tr>\n", + " <th>486</th>\n", + " <td>Louisiana</td>\n", + " <td>LA</td>\n", + " <td>22</td>\n", + " <td>2019</td>\n", + " <td>4648794</td>\n", + " </tr>\n", + " <tr>\n", + " <th>485</th>\n", + " <td>Kentucky</td>\n", + " <td>KY</td>\n", + " <td>21</td>\n", + " <td>2019</td>\n", + " <td>4467673</td>\n", + " </tr>\n", + " <tr>\n", + " <th>505</th>\n", + " <td>Oregon</td>\n", + " <td>OR</td>\n", + " <td>41</td>\n", + " <td>2019</td>\n", + " <td>4217737</td>\n", + " </tr>\n", + " <tr>\n", + " <th>504</th>\n", + " <td>Oklahoma</td>\n", + " <td>OK</td>\n", + " <td>40</td>\n", + " <td>2019</td>\n", + " <td>3956971</td>\n", + " </tr>\n", + " <tr>\n", + " <th>474</th>\n", + " <td>Connecticut</td>\n", + " <td>CT</td>\n", + " <td>9</td>\n", + " <td>2019</td>\n", + " <td>3565287</td>\n", + " </tr>\n", + " <tr>\n", + " <th>512</th>\n", + " <td>Utah</td>\n", + " <td>UT</td>\n", + " <td>49</td>\n", + " <td>2019</td>\n", + " <td>3205958</td>\n", + " </tr>\n", + " <tr>\n", + " <th>519</th>\n", + " <td>Puerto Rico</td>\n", + " <td>PR</td>\n", + " <td>72</td>\n", + " <td>2019</td>\n", + " <td>3193694</td>\n", + " </tr>\n", + " <tr>\n", + " <th>483</th>\n", + " <td>Iowa</td>\n", + " <td>IA</td>\n", + " <td>19</td>\n", + " <td>2019</td>\n", + " <td>3155070</td>\n", + " </tr>\n", + " <tr>\n", + " <th>496</th>\n", + " <td>Nevada</td>\n", + " <td>NV</td>\n", + " <td>32</td>\n", + " <td>2019</td>\n", + " <td>3080156</td>\n", + " </tr>\n", + " <tr>\n", + " <th>471</th>\n", + " <td>Arkansas</td>\n", + " <td>AR</td>\n", + " <td>5</td>\n", + " <td>2019</td>\n", + " <td>3017804</td>\n", + " </tr>\n", + " <tr>\n", + " <th>492</th>\n", + " <td>Mississippi</td>\n", + " <td>MS</td>\n", + " <td>28</td>\n", + " <td>2019</td>\n", + " <td>2976149</td>\n", + " </tr>\n", + " <tr>\n", + " <th>484</th>\n", + " <td>Kansas</td>\n", + " <td>KS</td>\n", + " <td>20</td>\n", + " <td>2019</td>\n", + " <td>2913314</td>\n", + " </tr>\n", + " <tr>\n", + " <th>499</th>\n", + " <td>New Mexico</td>\n", + " <td>NM</td>\n", + " <td>35</td>\n", + " <td>2019</td>\n", + " <td>2096829</td>\n", + " </tr>\n", + " <tr>\n", + " <th>495</th>\n", + " <td>Nebraska</td>\n", + " <td>NE</td>\n", + " <td>31</td>\n", + " <td>2019</td>\n", + " <td>1934408</td>\n", + " </tr>\n", + " <tr>\n", + " <th>516</th>\n", + " <td>West Virginia</td>\n", + " <td>WV</td>\n", + " <td>54</td>\n", + " <td>2019</td>\n", + " <td>1792147</td>\n", + " </tr>\n", + " <tr>\n", + " <th>480</th>\n", + " <td>Idaho</td>\n", + " <td>ID</td>\n", + " <td>16</td>\n", + " <td>2019</td>\n", + " <td>1787065</td>\n", + " </tr>\n", + " <tr>\n", + " <th>479</th>\n", + " <td>Hawaii</td>\n", + " <td>HI</td>\n", + " <td>15</td>\n", + " <td>2019</td>\n", + " <td>1415872</td>\n", + " </tr>\n", + " <tr>\n", + " <th>497</th>\n", + " <td>New Hampshire</td>\n", + " <td>NH</td>\n", + " <td>33</td>\n", + " <td>2019</td>\n", + " <td>1359711</td>\n", + " </tr>\n", + " <tr>\n", + " <th>487</th>\n", + " <td>Maine</td>\n", + " <td>ME</td>\n", + " <td>23</td>\n", + " <td>2019</td>\n", + " <td>1344212</td>\n", + " </tr>\n", + " <tr>\n", + " <th>494</th>\n", + " <td>Montana</td>\n", + " <td>MT</td>\n", + " <td>30</td>\n", + " <td>2019</td>\n", + " <td>1068778</td>\n", + " </tr>\n", + " <tr>\n", + " <th>507</th>\n", + " <td>Rhode Island</td>\n", + " <td>RI</td>\n", + " <td>44</td>\n", + " <td>2019</td>\n", + " <td>1059361</td>\n", + " </tr>\n", + " <tr>\n", + " <th>475</th>\n", + " <td>Delaware</td>\n", + " <td>DE</td>\n", + " <td>10</td>\n", + " <td>2019</td>\n", + " <td>973764</td>\n", + " </tr>\n", + " <tr>\n", + " <th>509</th>\n", + " <td>South Dakota</td>\n", + " <td>SD</td>\n", + " <td>46</td>\n", + " <td>2019</td>\n", + " <td>884659</td>\n", + " </tr>\n", + " <tr>\n", + " <th>502</th>\n", + " <td>North Dakota</td>\n", + " <td>ND</td>\n", + " <td>38</td>\n", + " <td>2019</td>\n", + " <td>762062</td>\n", + " </tr>\n", + " <tr>\n", + " <th>469</th>\n", + " <td>Alaska</td>\n", + " <td>AK</td>\n", + " <td>2</td>\n", + " <td>2019</td>\n", + " <td>731545</td>\n", + " </tr>\n", + " <tr>\n", + " <th>476</th>\n", + " <td>District of Columbia</td>\n", + " <td>DC</td>\n", + " <td>11</td>\n", + " <td>2019</td>\n", + " <td>705749</td>\n", + " </tr>\n", + " <tr>\n", + " <th>513</th>\n", + " <td>Vermont</td>\n", + " <td>VT</td>\n", + " <td>50</td>\n", + " <td>2019</td>\n", + " <td>623989</td>\n", + " </tr>\n", + " <tr>\n", + " <th>518</th>\n", + " <td>Wyoming</td>\n", + " <td>WY</td>\n", + " <td>56</td>\n", + " <td>2019</td>\n", + " <td>578759</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>\n", + " <div class=\"colab-df-buttons\">\n", + "\n", + " <div class=\"colab-df-container\">\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-823679c4-6265-489f-9458-deb15c36ff54')\"\n", + " title=\"Convert this dataframe to an interactive table.\"\n", + " style=\"display:none;\">\n", + "\n", + " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", + " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", + " </svg>\n", + " </button>\n", + "\n", + " <style>\n", + " .colab-df-container {\n", + " display:flex;\n", + " gap: 12px;\n", + " }\n", + "\n", + " .colab-df-convert {\n", + " background-color: #E8F0FE;\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: #1967D2;\n", + " height: 32px;\n", + " padding: 0 0 0 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-convert:hover {\n", + " background-color: #E2EBFA;\n", + " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: #174EA6;\n", + " }\n", + "\n", + " .colab-df-buttons div {\n", + " margin-bottom: 4px;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert {\n", + " background-color: #3B4455;\n", + " fill: #D2E3FC;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert:hover {\n", + " background-color: #434B5C;\n", + " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", + " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", + " fill: #FFFFFF;\n", + " }\n", + " </style>\n", + "\n", + " <script>\n", + " const buttonEl =\n", + " document.querySelector('#df-823679c4-6265-489f-9458-deb15c36ff54 button.colab-df-convert');\n", + " buttonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + "\n", + " async function convertToInteractive(key) {\n", + " const element = document.querySelector('#df-823679c4-6265-489f-9458-deb15c36ff54');\n", + " const dataTable =\n", + " await google.colab.kernel.invokeFunction('convertToInteractive',\n", + " [key], {});\n", + " if (!dataTable) return;\n", + "\n", + " const docLinkHtml = 'Like what you see? Visit the ' +\n", + " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", + " + ' to learn more about interactive tables.';\n", + " element.innerHTML = '';\n", + " dataTable['output_type'] = 'display_data';\n", + " await google.colab.output.renderOutput(dataTable, element);\n", + " const docLink = document.createElement('div');\n", + " docLink.innerHTML = docLinkHtml;\n", + " element.appendChild(docLink);\n", + " }\n", + " </script>\n", + " </div>\n", + "\n", + "\n", + "<div id=\"df-999b7e81-10cc-45e4-af77-3c1fab020b35\">\n", + " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-999b7e81-10cc-45e4-af77-3c1fab020b35')\"\n", + " title=\"Suggest charts\"\n", + " style=\"display:none;\">\n", + "\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", + " width=\"24px\">\n", + " <g>\n", + " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", + " </g>\n", + "</svg>\n", + " </button>\n", + "\n", + "<style>\n", + " .colab-df-quickchart {\n", + " --bg-color: #E8F0FE;\n", + " --fill-color: #1967D2;\n", + " --hover-bg-color: #E2EBFA;\n", + " --hover-fill-color: #174EA6;\n", + " --disabled-fill-color: #AAA;\n", + " --disabled-bg-color: #DDD;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-quickchart {\n", + " --bg-color: #3B4455;\n", + " --fill-color: #D2E3FC;\n", + " --hover-bg-color: #434B5C;\n", + " --hover-fill-color: #FFFFFF;\n", + " --disabled-bg-color: #3B4455;\n", + " --disabled-fill-color: #666;\n", + " }\n", + "\n", + " .colab-df-quickchart {\n", + " background-color: var(--bg-color);\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: var(--fill-color);\n", + " height: 32px;\n", + " padding: 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-quickchart:hover {\n", + " background-color: var(--hover-bg-color);\n", + " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: var(--button-hover-fill-color);\n", + " }\n", + "\n", + " .colab-df-quickchart-complete:disabled,\n", + " .colab-df-quickchart-complete:disabled:hover {\n", + " background-color: var(--disabled-bg-color);\n", + " fill: var(--disabled-fill-color);\n", + " box-shadow: none;\n", + " }\n", + "\n", + " .colab-df-spinner {\n", + " border: 2px solid var(--fill-color);\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " animation:\n", + " spin 1s steps(1) infinite;\n", + " }\n", + "\n", + " @keyframes spin {\n", + " 0% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " border-left-color: var(--fill-color);\n", + " }\n", + " 20% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 30% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 40% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 60% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 80% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " 90% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " }\n", + "</style>\n", + "\n", + " <script>\n", + " async function quickchart(key) {\n", + " const quickchartButtonEl =\n", + " document.querySelector('#' + key + ' button');\n", + " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", + " quickchartButtonEl.classList.add('colab-df-spinner');\n", + " try {\n", + " const charts = await google.colab.kernel.invokeFunction(\n", + " 'suggestCharts', [key], {});\n", + " } catch (error) {\n", + " console.error('Error during call to suggestCharts:', error);\n", + " }\n", + " quickchartButtonEl.classList.remove('colab-df-spinner');\n", + " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", + " }\n", + " (() => {\n", + " let quickchartButtonEl =\n", + " document.querySelector('#df-999b7e81-10cc-45e4-af77-3c1fab020b35 button');\n", + " quickchartButtonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + " })();\n", + " </script>\n", + "</div>\n", + " </div>\n", + " </div>\n" + ] + }, + "metadata": {}, + "execution_count": 9 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Calculate population difference between selected and previous year\n", + "def calculate_population_difference(input_df, input_year):\n", + " selected_year_data = input_df[input_df['year'] == input_year].reset_index()\n", + " previous_year_data = input_df[input_df['year'] == input_year - 1].reset_index()\n", + " selected_year_data['population_difference'] = selected_year_data.population.sub(previous_year_data.population, fill_value=0)\n", + " selected_year_data['population_difference_absolute'] = abs(selected_year_data['population_difference'])\n", + " return pd.concat([selected_year_data.states, selected_year_data.id, selected_year_data.population, selected_year_data.population_difference, selected_year_data.population_difference_absolute], axis=1).sort_values(by=\"population_difference\", ascending=False)\n", + "\n", + "df_population_difference_sorted = calculate_population_difference(df_reshaped, selected_year)\n", + "df_population_difference_sorted" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "JM8sxDepnwMG", + "outputId": "f123e0f1-b1a2-4a41-b4c0-420b70fe5a53" + }, + "execution_count": 10, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " states id population population_difference \\\n", + "43 Texas 48 28995881 367215 \n", + "9 Florida 12 21477737 233420 \n", + "2 Arizona 4 7278717 120693 \n", + "33 North Carolina 37 10488084 106469 \n", + "10 Georgia 13 10617423 106292 \n", + "47 Washington 53 7614893 91024 \n", + "5 Colorado 8 5758736 67449 \n", + "40 South Carolina 45 5148714 64558 \n", + "42 Tennessee 47 6829174 57543 \n", + "28 Nevada 32 3080156 52815 \n", + "44 Utah 49 3205958 52408 \n", + "4 California 6 39512223 50635 \n", + "14 Indiana 18 6732219 36722 \n", + "12 Idaho 16 1787065 36529 \n", + "37 Oregon 41 4217737 35851 \n", + "46 Virginia 51 8535519 34233 \n", + "23 Minnesota 27 5639632 33383 \n", + "36 Oklahoma 40 3956971 16736 \n", + "25 Missouri 29 6137428 15805 \n", + "0 Alabama 1 4903185 15504 \n", + "49 Wisconsin 55 5822434 15028 \n", + "35 Ohio 39 11689100 12759 \n", + "20 Maryland 24 6045680 9878 \n", + "21 Massachusetts 25 6892503 9868 \n", + "27 Nebraska 31 1934408 8794 \n", + "7 Delaware 10 973764 8285 \n", + "26 Montana 30 1068778 8113 \n", + "3 Arkansas 5 3017804 8071 \n", + "17 Kentucky 21 4467673 6520 \n", + "15 Iowa 19 3155070 6452 \n", + "29 New Hampshire 33 1359711 6246 \n", + "41 South Dakota 46 884659 5961 \n", + "19 Maine 23 1344212 5155 \n", + "8 District of Columbia 11 705749 4202 \n", + "31 New Mexico 35 2096829 4088 \n", + "34 North Dakota 38 762062 3982 \n", + "22 Michigan 26 9986857 2785 \n", + "16 Kansas 20 2913314 1955 \n", + "50 Wyoming 56 578759 1158 \n", + "39 Rhode Island 44 1059361 1074 \n", + "38 Pennsylvania 42 12801989 1067 \n", + "51 Puerto Rico 72 3193694 340 \n", + "45 Vermont 50 623989 -369 \n", + "1 Alaska 2 731545 -3594 \n", + "30 New Jersey 34 8882190 -3835 \n", + "11 Hawaii 15 1415872 -4721 \n", + "24 Mississippi 28 2976149 -4871 \n", + "6 Connecticut 9 3565287 -6233 \n", + "18 Louisiana 22 4648794 -10896 \n", + "48 West Virginia 54 1792147 -12144 \n", + "13 Illinois 17 12671821 -51250 \n", + "32 New York 36 19453561 -76790 \n", + "\n", + " population_difference_absolute \n", + "43 367215 \n", + "9 233420 \n", + "2 120693 \n", + "33 106469 \n", + "10 106292 \n", + "47 91024 \n", + "5 67449 \n", + "40 64558 \n", + "42 57543 \n", + "28 52815 \n", + "44 52408 \n", + "4 50635 \n", + "14 36722 \n", + "12 36529 \n", + "37 35851 \n", + "46 34233 \n", + "23 33383 \n", + "36 16736 \n", + "25 15805 \n", + "0 15504 \n", + "49 15028 \n", + "35 12759 \n", + "20 9878 \n", + "21 9868 \n", + "27 8794 \n", + "7 8285 \n", + "26 8113 \n", + "3 8071 \n", + "17 6520 \n", + "15 6452 \n", + "29 6246 \n", + "41 5961 \n", + "19 5155 \n", + "8 4202 \n", + "31 4088 \n", + "34 3982 \n", + "22 2785 \n", + "16 1955 \n", + "50 1158 \n", + "39 1074 \n", + "38 1067 \n", + "51 340 \n", + "45 369 \n", + "1 3594 \n", + "30 3835 \n", + "11 4721 \n", + "24 4871 \n", + "6 6233 \n", + "18 10896 \n", + "48 12144 \n", + "13 51250 \n", + "32 76790 " + ], + "text/html": [ + "\n", + " <div id=\"df-66f5b0a5-5b93-417b-ba83-eb317d7b0af6\" class=\"colab-df-container\">\n", + " <div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>states</th>\n", + " <th>id</th>\n", + " <th>population</th>\n", + " <th>population_difference</th>\n", + " <th>population_difference_absolute</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>43</th>\n", + " <td>Texas</td>\n", + " <td>48</td>\n", + " <td>28995881</td>\n", + " <td>367215</td>\n", + " <td>367215</td>\n", + " </tr>\n", + " <tr>\n", + " <th>9</th>\n", + " <td>Florida</td>\n", + " <td>12</td>\n", + " <td>21477737</td>\n", + " <td>233420</td>\n", + " <td>233420</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <td>Arizona</td>\n", + " <td>4</td>\n", + " <td>7278717</td>\n", + " <td>120693</td>\n", + " <td>120693</td>\n", + " </tr>\n", + " <tr>\n", + " <th>33</th>\n", + " <td>North Carolina</td>\n", + " <td>37</td>\n", + " <td>10488084</td>\n", + " <td>106469</td>\n", + " <td>106469</td>\n", + " </tr>\n", + " <tr>\n", + " <th>10</th>\n", + " <td>Georgia</td>\n", + " <td>13</td>\n", + " <td>10617423</td>\n", + " <td>106292</td>\n", + " <td>106292</td>\n", + " </tr>\n", + " <tr>\n", + " <th>47</th>\n", + " <td>Washington</td>\n", + " <td>53</td>\n", + " <td>7614893</td>\n", + " <td>91024</td>\n", + " <td>91024</td>\n", + " </tr>\n", + " <tr>\n", + " <th>5</th>\n", + " <td>Colorado</td>\n", + " <td>8</td>\n", + " <td>5758736</td>\n", + " <td>67449</td>\n", + " <td>67449</td>\n", + " </tr>\n", + " <tr>\n", + " <th>40</th>\n", + " <td>South Carolina</td>\n", + " <td>45</td>\n", + " <td>5148714</td>\n", + " <td>64558</td>\n", + " <td>64558</td>\n", + " </tr>\n", + " <tr>\n", + " <th>42</th>\n", + " <td>Tennessee</td>\n", + " <td>47</td>\n", + " <td>6829174</td>\n", + " <td>57543</td>\n", + " <td>57543</td>\n", + " </tr>\n", + " <tr>\n", + " <th>28</th>\n", + " <td>Nevada</td>\n", + " <td>32</td>\n", + " <td>3080156</td>\n", + " <td>52815</td>\n", + " <td>52815</td>\n", + " </tr>\n", + " <tr>\n", + " <th>44</th>\n", + " <td>Utah</td>\n", + " <td>49</td>\n", + " <td>3205958</td>\n", + " <td>52408</td>\n", + " <td>52408</td>\n", + " </tr>\n", + " <tr>\n", + " <th>4</th>\n", + " <td>California</td>\n", + " <td>6</td>\n", + " <td>39512223</td>\n", + " <td>50635</td>\n", + " <td>50635</td>\n", + " </tr>\n", + " <tr>\n", + " <th>14</th>\n", + " <td>Indiana</td>\n", + " <td>18</td>\n", + " <td>6732219</td>\n", + " <td>36722</td>\n", + " <td>36722</td>\n", + " </tr>\n", + " <tr>\n", + " <th>12</th>\n", + " <td>Idaho</td>\n", + " <td>16</td>\n", + " <td>1787065</td>\n", + " <td>36529</td>\n", + " <td>36529</td>\n", + " </tr>\n", + " <tr>\n", + " <th>37</th>\n", + " <td>Oregon</td>\n", + " <td>41</td>\n", + " <td>4217737</td>\n", + " <td>35851</td>\n", + " <td>35851</td>\n", + " </tr>\n", + " <tr>\n", + " <th>46</th>\n", + " <td>Virginia</td>\n", + " <td>51</td>\n", + " <td>8535519</td>\n", + " <td>34233</td>\n", + " <td>34233</td>\n", + " </tr>\n", + " <tr>\n", + " <th>23</th>\n", + " <td>Minnesota</td>\n", + " <td>27</td>\n", + " <td>5639632</td>\n", + " <td>33383</td>\n", + " <td>33383</td>\n", + " </tr>\n", + " <tr>\n", + " <th>36</th>\n", + " <td>Oklahoma</td>\n", + " <td>40</td>\n", + " <td>3956971</td>\n", + " <td>16736</td>\n", + " <td>16736</td>\n", + " </tr>\n", + " <tr>\n", + " <th>25</th>\n", + " <td>Missouri</td>\n", + " <td>29</td>\n", + " <td>6137428</td>\n", + " <td>15805</td>\n", + " <td>15805</td>\n", + " </tr>\n", + " <tr>\n", + " <th>0</th>\n", + " <td>Alabama</td>\n", + " <td>1</td>\n", + " <td>4903185</td>\n", + " <td>15504</td>\n", + " <td>15504</td>\n", + " </tr>\n", + " <tr>\n", + " <th>49</th>\n", + " <td>Wisconsin</td>\n", + " <td>55</td>\n", + " <td>5822434</td>\n", + " <td>15028</td>\n", + " <td>15028</td>\n", + " </tr>\n", + " <tr>\n", + " <th>35</th>\n", + " <td>Ohio</td>\n", + " <td>39</td>\n", + " <td>11689100</td>\n", + " <td>12759</td>\n", + " <td>12759</td>\n", + " </tr>\n", + " <tr>\n", + " <th>20</th>\n", + " <td>Maryland</td>\n", + " <td>24</td>\n", + " <td>6045680</td>\n", + " <td>9878</td>\n", + " <td>9878</td>\n", + " </tr>\n", + " <tr>\n", + " <th>21</th>\n", + " <td>Massachusetts</td>\n", + " <td>25</td>\n", + " <td>6892503</td>\n", + " <td>9868</td>\n", + " <td>9868</td>\n", + " </tr>\n", + " <tr>\n", + " <th>27</th>\n", + " <td>Nebraska</td>\n", + " <td>31</td>\n", + " <td>1934408</td>\n", + " <td>8794</td>\n", + " <td>8794</td>\n", + " </tr>\n", + " <tr>\n", + " <th>7</th>\n", + " <td>Delaware</td>\n", + " <td>10</td>\n", + " <td>973764</td>\n", + " <td>8285</td>\n", + " <td>8285</td>\n", + " </tr>\n", + " <tr>\n", + " <th>26</th>\n", + " <td>Montana</td>\n", + " <td>30</td>\n", + " <td>1068778</td>\n", + " <td>8113</td>\n", + " <td>8113</td>\n", + " </tr>\n", + " <tr>\n", + " <th>3</th>\n", + " <td>Arkansas</td>\n", + " <td>5</td>\n", + " <td>3017804</td>\n", + " <td>8071</td>\n", + " <td>8071</td>\n", + " </tr>\n", + " <tr>\n", + " <th>17</th>\n", + " <td>Kentucky</td>\n", + " <td>21</td>\n", + " <td>4467673</td>\n", + " <td>6520</td>\n", + " <td>6520</td>\n", + " </tr>\n", + " <tr>\n", + " <th>15</th>\n", + " <td>Iowa</td>\n", + " <td>19</td>\n", + " <td>3155070</td>\n", + " <td>6452</td>\n", + " <td>6452</td>\n", + " </tr>\n", + " <tr>\n", + " <th>29</th>\n", + " <td>New Hampshire</td>\n", + " <td>33</td>\n", + " <td>1359711</td>\n", + " <td>6246</td>\n", + " <td>6246</td>\n", + " </tr>\n", + " <tr>\n", + " <th>41</th>\n", + " <td>South Dakota</td>\n", + " <td>46</td>\n", + " <td>884659</td>\n", + " <td>5961</td>\n", + " <td>5961</td>\n", + " </tr>\n", + " <tr>\n", + " <th>19</th>\n", + " <td>Maine</td>\n", + " <td>23</td>\n", + " <td>1344212</td>\n", + " <td>5155</td>\n", + " <td>5155</td>\n", + " </tr>\n", + " <tr>\n", + " <th>8</th>\n", + " <td>District of Columbia</td>\n", + " <td>11</td>\n", + " <td>705749</td>\n", + " <td>4202</td>\n", + " <td>4202</td>\n", + " </tr>\n", + " <tr>\n", + " <th>31</th>\n", + " <td>New Mexico</td>\n", + " <td>35</td>\n", + " <td>2096829</td>\n", + " <td>4088</td>\n", + " <td>4088</td>\n", + " </tr>\n", + " <tr>\n", + " <th>34</th>\n", + " <td>North Dakota</td>\n", + " <td>38</td>\n", + " <td>762062</td>\n", + " <td>3982</td>\n", + " <td>3982</td>\n", + " </tr>\n", + " <tr>\n", + " <th>22</th>\n", + " <td>Michigan</td>\n", + " <td>26</td>\n", + " <td>9986857</td>\n", + " <td>2785</td>\n", + " <td>2785</td>\n", + " </tr>\n", + " <tr>\n", + " <th>16</th>\n", + " <td>Kansas</td>\n", + " <td>20</td>\n", + " <td>2913314</td>\n", + " <td>1955</td>\n", + " <td>1955</td>\n", + " </tr>\n", + " <tr>\n", + " <th>50</th>\n", + " <td>Wyoming</td>\n", + " <td>56</td>\n", + " <td>578759</td>\n", + " <td>1158</td>\n", + " <td>1158</td>\n", + " </tr>\n", + " <tr>\n", + " <th>39</th>\n", + " <td>Rhode Island</td>\n", + " <td>44</td>\n", + " <td>1059361</td>\n", + " <td>1074</td>\n", + " <td>1074</td>\n", + " </tr>\n", + " <tr>\n", + " <th>38</th>\n", + " <td>Pennsylvania</td>\n", + " <td>42</td>\n", + " <td>12801989</td>\n", + " <td>1067</td>\n", + " <td>1067</td>\n", + " </tr>\n", + " <tr>\n", + " <th>51</th>\n", + " <td>Puerto Rico</td>\n", + " <td>72</td>\n", + " <td>3193694</td>\n", + " <td>340</td>\n", + " <td>340</td>\n", + " </tr>\n", + " <tr>\n", + " <th>45</th>\n", + " <td>Vermont</td>\n", + " <td>50</td>\n", + " <td>623989</td>\n", + " <td>-369</td>\n", + " <td>369</td>\n", + " </tr>\n", + " <tr>\n", + " <th>1</th>\n", + " <td>Alaska</td>\n", + " <td>2</td>\n", + " <td>731545</td>\n", + " <td>-3594</td>\n", + " <td>3594</td>\n", + " </tr>\n", + " <tr>\n", + " <th>30</th>\n", + " <td>New Jersey</td>\n", + " <td>34</td>\n", + " <td>8882190</td>\n", + " <td>-3835</td>\n", + " <td>3835</td>\n", + " </tr>\n", + " <tr>\n", + " <th>11</th>\n", + " <td>Hawaii</td>\n", + " <td>15</td>\n", + " <td>1415872</td>\n", + " <td>-4721</td>\n", + " <td>4721</td>\n", + " </tr>\n", + " <tr>\n", + " <th>24</th>\n", + " <td>Mississippi</td>\n", + " <td>28</td>\n", + " <td>2976149</td>\n", + " <td>-4871</td>\n", + " <td>4871</td>\n", + " </tr>\n", + " <tr>\n", + " <th>6</th>\n", + " <td>Connecticut</td>\n", + " <td>9</td>\n", + " <td>3565287</td>\n", + " <td>-6233</td>\n", + " <td>6233</td>\n", + " </tr>\n", + " <tr>\n", + " <th>18</th>\n", + " <td>Louisiana</td>\n", + " <td>22</td>\n", + " <td>4648794</td>\n", + " <td>-10896</td>\n", + " <td>10896</td>\n", + " </tr>\n", + " <tr>\n", + " <th>48</th>\n", + " <td>West Virginia</td>\n", + " <td>54</td>\n", + " <td>1792147</td>\n", + " <td>-12144</td>\n", + " <td>12144</td>\n", + " </tr>\n", + " <tr>\n", + " <th>13</th>\n", + " <td>Illinois</td>\n", + " <td>17</td>\n", + " <td>12671821</td>\n", + " <td>-51250</td>\n", + " <td>51250</td>\n", + " </tr>\n", + " <tr>\n", + " <th>32</th>\n", + " <td>New York</td>\n", + " <td>36</td>\n", + " <td>19453561</td>\n", + " <td>-76790</td>\n", + " <td>76790</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>\n", + " <div class=\"colab-df-buttons\">\n", + "\n", + " <div class=\"colab-df-container\">\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-66f5b0a5-5b93-417b-ba83-eb317d7b0af6')\"\n", + " title=\"Convert this dataframe to an interactive table.\"\n", + " style=\"display:none;\">\n", + "\n", + " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", + " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", + " </svg>\n", + " </button>\n", + "\n", + " <style>\n", + " .colab-df-container {\n", + " display:flex;\n", + " gap: 12px;\n", + " }\n", + "\n", + " .colab-df-convert {\n", + " background-color: #E8F0FE;\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: #1967D2;\n", + " height: 32px;\n", + " padding: 0 0 0 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-convert:hover {\n", + " background-color: #E2EBFA;\n", + " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: #174EA6;\n", + " }\n", + "\n", + " .colab-df-buttons div {\n", + " margin-bottom: 4px;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert {\n", + " background-color: #3B4455;\n", + " fill: #D2E3FC;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert:hover {\n", + " background-color: #434B5C;\n", + " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", + " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", + " fill: #FFFFFF;\n", + " }\n", + " </style>\n", + "\n", + " <script>\n", + " const buttonEl =\n", + " document.querySelector('#df-66f5b0a5-5b93-417b-ba83-eb317d7b0af6 button.colab-df-convert');\n", + " buttonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + "\n", + " async function convertToInteractive(key) {\n", + " const element = document.querySelector('#df-66f5b0a5-5b93-417b-ba83-eb317d7b0af6');\n", + " const dataTable =\n", + " await google.colab.kernel.invokeFunction('convertToInteractive',\n", + " [key], {});\n", + " if (!dataTable) return;\n", + "\n", + " const docLinkHtml = 'Like what you see? Visit the ' +\n", + " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", + " + ' to learn more about interactive tables.';\n", + " element.innerHTML = '';\n", + " dataTable['output_type'] = 'display_data';\n", + " await google.colab.output.renderOutput(dataTable, element);\n", + " const docLink = document.createElement('div');\n", + " docLink.innerHTML = docLinkHtml;\n", + " element.appendChild(docLink);\n", + " }\n", + " </script>\n", + " </div>\n", + "\n", + "\n", + "<div id=\"df-b89c8dc5-f441-43fd-8298-c61a8a00e918\">\n", + " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-b89c8dc5-f441-43fd-8298-c61a8a00e918')\"\n", + " title=\"Suggest charts\"\n", + " style=\"display:none;\">\n", + "\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", + " width=\"24px\">\n", + " <g>\n", + " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", + " </g>\n", + "</svg>\n", + " </button>\n", + "\n", + "<style>\n", + " .colab-df-quickchart {\n", + " --bg-color: #E8F0FE;\n", + " --fill-color: #1967D2;\n", + " --hover-bg-color: #E2EBFA;\n", + " --hover-fill-color: #174EA6;\n", + " --disabled-fill-color: #AAA;\n", + " --disabled-bg-color: #DDD;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-quickchart {\n", + " --bg-color: #3B4455;\n", + " --fill-color: #D2E3FC;\n", + " --hover-bg-color: #434B5C;\n", + " --hover-fill-color: #FFFFFF;\n", + " --disabled-bg-color: #3B4455;\n", + " --disabled-fill-color: #666;\n", + " }\n", + "\n", + " .colab-df-quickchart {\n", + " background-color: var(--bg-color);\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: var(--fill-color);\n", + " height: 32px;\n", + " padding: 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-quickchart:hover {\n", + " background-color: var(--hover-bg-color);\n", + " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: var(--button-hover-fill-color);\n", + " }\n", + "\n", + " .colab-df-quickchart-complete:disabled,\n", + " .colab-df-quickchart-complete:disabled:hover {\n", + " background-color: var(--disabled-bg-color);\n", + " fill: var(--disabled-fill-color);\n", + " box-shadow: none;\n", + " }\n", + "\n", + " .colab-df-spinner {\n", + " border: 2px solid var(--fill-color);\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " animation:\n", + " spin 1s steps(1) infinite;\n", + " }\n", + "\n", + " @keyframes spin {\n", + " 0% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " border-left-color: var(--fill-color);\n", + " }\n", + " 20% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 30% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 40% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 60% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 80% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " 90% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " }\n", + "</style>\n", + "\n", + " <script>\n", + " async function quickchart(key) {\n", + " const quickchartButtonEl =\n", + " document.querySelector('#' + key + ' button');\n", + " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", + " quickchartButtonEl.classList.add('colab-df-spinner');\n", + " try {\n", + " const charts = await google.colab.kernel.invokeFunction(\n", + " 'suggestCharts', [key], {});\n", + " } catch (error) {\n", + " console.error('Error during call to suggestCharts:', error);\n", + " }\n", + " quickchartButtonEl.classList.remove('colab-df-spinner');\n", + " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", + " }\n", + " (() => {\n", + " let quickchartButtonEl =\n", + " document.querySelector('#df-b89c8dc5-f441-43fd-8298-c61a8a00e918 button');\n", + " quickchartButtonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + " })();\n", + " </script>\n", + "</div>\n", + " </div>\n", + " </div>\n" + ] + }, + "metadata": {}, + "execution_count": 10 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Filter states with population difference > 50000\n", + "df_greater_50000 = df_population_difference_sorted[df_population_difference_sorted.population_difference_absolute > 50000]\n", + "df_greater_50000" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 488 + }, + "id": "kjtiLBxV6cNq", + "outputId": "3989fa48-8d64-4114-d3cd-63c07daf4127" + }, + "execution_count": 11, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + " states id population population_difference \\\n", + "43 Texas 48 28995881 367215 \n", + "9 Florida 12 21477737 233420 \n", + "2 Arizona 4 7278717 120693 \n", + "33 North Carolina 37 10488084 106469 \n", + "10 Georgia 13 10617423 106292 \n", + "47 Washington 53 7614893 91024 \n", + "5 Colorado 8 5758736 67449 \n", + "40 South Carolina 45 5148714 64558 \n", + "42 Tennessee 47 6829174 57543 \n", + "28 Nevada 32 3080156 52815 \n", + "44 Utah 49 3205958 52408 \n", + "4 California 6 39512223 50635 \n", + "13 Illinois 17 12671821 -51250 \n", + "32 New York 36 19453561 -76790 \n", + "\n", + " population_difference_absolute \n", + "43 367215 \n", + "9 233420 \n", + "2 120693 \n", + "33 106469 \n", + "10 106292 \n", + "47 91024 \n", + "5 67449 \n", + "40 64558 \n", + "42 57543 \n", + "28 52815 \n", + "44 52408 \n", + "4 50635 \n", + "13 51250 \n", + "32 76790 " + ], + "text/html": [ + "\n", + " <div id=\"df-4cb8e0b1-bc14-47bb-bab1-5f4af8b6cb46\" class=\"colab-df-container\">\n", + " <div>\n", + "<style scoped>\n", + " .dataframe tbody tr th:only-of-type {\n", + " vertical-align: middle;\n", + " }\n", + "\n", + " .dataframe tbody tr th {\n", + " vertical-align: top;\n", + " }\n", + "\n", + " .dataframe thead th {\n", + " text-align: right;\n", + " }\n", + "</style>\n", + "<table border=\"1\" class=\"dataframe\">\n", + " <thead>\n", + " <tr style=\"text-align: right;\">\n", + " <th></th>\n", + " <th>states</th>\n", + " <th>id</th>\n", + " <th>population</th>\n", + " <th>population_difference</th>\n", + " <th>population_difference_absolute</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <th>43</th>\n", + " <td>Texas</td>\n", + " <td>48</td>\n", + " <td>28995881</td>\n", + " <td>367215</td>\n", + " <td>367215</td>\n", + " </tr>\n", + " <tr>\n", + " <th>9</th>\n", + " <td>Florida</td>\n", + " <td>12</td>\n", + " <td>21477737</td>\n", + " <td>233420</td>\n", + " <td>233420</td>\n", + " </tr>\n", + " <tr>\n", + " <th>2</th>\n", + " <td>Arizona</td>\n", + " <td>4</td>\n", + " <td>7278717</td>\n", + " <td>120693</td>\n", + " <td>120693</td>\n", + " </tr>\n", + " <tr>\n", + " <th>33</th>\n", + " <td>North Carolina</td>\n", + " <td>37</td>\n", + " <td>10488084</td>\n", + " <td>106469</td>\n", + " <td>106469</td>\n", + " </tr>\n", + " <tr>\n", + " <th>10</th>\n", + " <td>Georgia</td>\n", + " <td>13</td>\n", + " <td>10617423</td>\n", + " <td>106292</td>\n", + " <td>106292</td>\n", + " </tr>\n", + " <tr>\n", + " <th>47</th>\n", + " <td>Washington</td>\n", + " <td>53</td>\n", + " <td>7614893</td>\n", + " <td>91024</td>\n", + " <td>91024</td>\n", + " </tr>\n", + " <tr>\n", + " <th>5</th>\n", + " <td>Colorado</td>\n", + " <td>8</td>\n", + " <td>5758736</td>\n", + " <td>67449</td>\n", + " <td>67449</td>\n", + " </tr>\n", + " <tr>\n", + " <th>40</th>\n", + " <td>South Carolina</td>\n", + " <td>45</td>\n", + " <td>5148714</td>\n", + " <td>64558</td>\n", + " <td>64558</td>\n", + " </tr>\n", + " <tr>\n", + " <th>42</th>\n", + " <td>Tennessee</td>\n", + " <td>47</td>\n", + " <td>6829174</td>\n", + " <td>57543</td>\n", + " <td>57543</td>\n", + " </tr>\n", + " <tr>\n", + " <th>28</th>\n", + " <td>Nevada</td>\n", + " <td>32</td>\n", + " <td>3080156</td>\n", + " <td>52815</td>\n", + " <td>52815</td>\n", + " </tr>\n", + " <tr>\n", + " <th>44</th>\n", + " <td>Utah</td>\n", + " <td>49</td>\n", + " <td>3205958</td>\n", + " <td>52408</td>\n", + " <td>52408</td>\n", + " </tr>\n", + " <tr>\n", + " <th>4</th>\n", + " <td>California</td>\n", + " <td>6</td>\n", + " <td>39512223</td>\n", + " <td>50635</td>\n", + " <td>50635</td>\n", + " </tr>\n", + " <tr>\n", + " <th>13</th>\n", + " <td>Illinois</td>\n", + " <td>17</td>\n", + " <td>12671821</td>\n", + " <td>-51250</td>\n", + " <td>51250</td>\n", + " </tr>\n", + " <tr>\n", + " <th>32</th>\n", + " <td>New York</td>\n", + " <td>36</td>\n", + " <td>19453561</td>\n", + " <td>-76790</td>\n", + " <td>76790</td>\n", + " </tr>\n", + " </tbody>\n", + "</table>\n", + "</div>\n", + " <div class=\"colab-df-buttons\">\n", + "\n", + " <div class=\"colab-df-container\">\n", + " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-4cb8e0b1-bc14-47bb-bab1-5f4af8b6cb46')\"\n", + " title=\"Convert this dataframe to an interactive table.\"\n", + " style=\"display:none;\">\n", + "\n", + " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n", + " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n", + " </svg>\n", + " </button>\n", + "\n", + " <style>\n", + " .colab-df-container {\n", + " display:flex;\n", + " gap: 12px;\n", + " }\n", + "\n", + " .colab-df-convert {\n", + " background-color: #E8F0FE;\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: #1967D2;\n", + " height: 32px;\n", + " padding: 0 0 0 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-convert:hover {\n", + " background-color: #E2EBFA;\n", + " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: #174EA6;\n", + " }\n", + "\n", + " .colab-df-buttons div {\n", + " margin-bottom: 4px;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert {\n", + " background-color: #3B4455;\n", + " fill: #D2E3FC;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-convert:hover {\n", + " background-color: #434B5C;\n", + " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n", + " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n", + " fill: #FFFFFF;\n", + " }\n", + " </style>\n", + "\n", + " <script>\n", + " const buttonEl =\n", + " document.querySelector('#df-4cb8e0b1-bc14-47bb-bab1-5f4af8b6cb46 button.colab-df-convert');\n", + " buttonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + "\n", + " async function convertToInteractive(key) {\n", + " const element = document.querySelector('#df-4cb8e0b1-bc14-47bb-bab1-5f4af8b6cb46');\n", + " const dataTable =\n", + " await google.colab.kernel.invokeFunction('convertToInteractive',\n", + " [key], {});\n", + " if (!dataTable) return;\n", + "\n", + " const docLinkHtml = 'Like what you see? Visit the ' +\n", + " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n", + " + ' to learn more about interactive tables.';\n", + " element.innerHTML = '';\n", + " dataTable['output_type'] = 'display_data';\n", + " await google.colab.output.renderOutput(dataTable, element);\n", + " const docLink = document.createElement('div');\n", + " docLink.innerHTML = docLinkHtml;\n", + " element.appendChild(docLink);\n", + " }\n", + " </script>\n", + " </div>\n", + "\n", + "\n", + "<div id=\"df-ee256af6-380a-4c31-9ad9-eb143631d371\">\n", + " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-ee256af6-380a-4c31-9ad9-eb143631d371')\"\n", + " title=\"Suggest charts\"\n", + " style=\"display:none;\">\n", + "\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n", + " width=\"24px\">\n", + " <g>\n", + " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n", + " </g>\n", + "</svg>\n", + " </button>\n", + "\n", + "<style>\n", + " .colab-df-quickchart {\n", + " --bg-color: #E8F0FE;\n", + " --fill-color: #1967D2;\n", + " --hover-bg-color: #E2EBFA;\n", + " --hover-fill-color: #174EA6;\n", + " --disabled-fill-color: #AAA;\n", + " --disabled-bg-color: #DDD;\n", + " }\n", + "\n", + " [theme=dark] .colab-df-quickchart {\n", + " --bg-color: #3B4455;\n", + " --fill-color: #D2E3FC;\n", + " --hover-bg-color: #434B5C;\n", + " --hover-fill-color: #FFFFFF;\n", + " --disabled-bg-color: #3B4455;\n", + " --disabled-fill-color: #666;\n", + " }\n", + "\n", + " .colab-df-quickchart {\n", + " background-color: var(--bg-color);\n", + " border: none;\n", + " border-radius: 50%;\n", + " cursor: pointer;\n", + " display: none;\n", + " fill: var(--fill-color);\n", + " height: 32px;\n", + " padding: 0;\n", + " width: 32px;\n", + " }\n", + "\n", + " .colab-df-quickchart:hover {\n", + " background-color: var(--hover-bg-color);\n", + " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n", + " fill: var(--button-hover-fill-color);\n", + " }\n", + "\n", + " .colab-df-quickchart-complete:disabled,\n", + " .colab-df-quickchart-complete:disabled:hover {\n", + " background-color: var(--disabled-bg-color);\n", + " fill: var(--disabled-fill-color);\n", + " box-shadow: none;\n", + " }\n", + "\n", + " .colab-df-spinner {\n", + " border: 2px solid var(--fill-color);\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " animation:\n", + " spin 1s steps(1) infinite;\n", + " }\n", + "\n", + " @keyframes spin {\n", + " 0% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " border-left-color: var(--fill-color);\n", + " }\n", + " 20% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 30% {\n", + " border-color: transparent;\n", + " border-left-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 40% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-top-color: var(--fill-color);\n", + " }\n", + " 60% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " }\n", + " 80% {\n", + " border-color: transparent;\n", + " border-right-color: var(--fill-color);\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " 90% {\n", + " border-color: transparent;\n", + " border-bottom-color: var(--fill-color);\n", + " }\n", + " }\n", + "</style>\n", + "\n", + " <script>\n", + " async function quickchart(key) {\n", + " const quickchartButtonEl =\n", + " document.querySelector('#' + key + ' button');\n", + " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n", + " quickchartButtonEl.classList.add('colab-df-spinner');\n", + " try {\n", + " const charts = await google.colab.kernel.invokeFunction(\n", + " 'suggestCharts', [key], {});\n", + " } catch (error) {\n", + " console.error('Error during call to suggestCharts:', error);\n", + " }\n", + " quickchartButtonEl.classList.remove('colab-df-spinner');\n", + " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n", + " }\n", + " (() => {\n", + " let quickchartButtonEl =\n", + " document.querySelector('#df-ee256af6-380a-4c31-9ad9-eb143631d371 button');\n", + " quickchartButtonEl.style.display =\n", + " google.colab.kernel.accessAllowed ? 'block' : 'none';\n", + " })();\n", + " </script>\n", + "</div>\n", + " </div>\n", + " </div>\n" + ] + }, + "metadata": {}, + "execution_count": 11 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# % of States with population difference > 50000\n", + "int((len(df_greater_50000)/df_population_difference_sorted.states.nunique())*100)" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "085JORge7E2N", + "outputId": "ec84f197-5224-42f4-97f2-e880fab8219e" + }, + "execution_count": 12, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "26" + ] + }, + "metadata": {}, + "execution_count": 12 + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Plots" + ], + "metadata": { + "id": "GnY0jA7irX1Z" + } + }, + { + "cell_type": "markdown", + "source": [ + "### Heatmap" + ], + "metadata": { + "id": "hRrwBt3skrp1" + } + }, + { + "cell_type": "code", + "source": [ + "import altair as alt\n", + "\n", + "alt.themes.enable(\"dark\")\n", + "\n", + "heatmap = alt.Chart(df_reshaped).mark_rect().encode(\n", + " y=alt.Y('year:O', axis=alt.Axis(title=\"Year\", titleFontSize=16, titlePadding=15, titleFontWeight=900, labelAngle=0)),\n", + " x=alt.X('states:O', axis=alt.Axis(title=\"States\", titleFontSize=16, titlePadding=15, titleFontWeight=900)),\n", + " color=alt.Color('max(population):Q',\n", + " legend=alt.Legend(title=\" \"),\n", + " scale=alt.Scale(scheme=\"blueorange\")),\n", + " stroke=alt.value('black'),\n", + " strokeWidth=alt.value(0.25),\n", + " #tooltip=[\n", + " # alt.Tooltip('year:O', title='Year'),\n", + " # alt.Tooltip('population:Q', title='Population')\n", + " #]\n", + " ).properties(width=900\n", + " #).configure_legend(orient='bottom', titleFontSize=16, labelFontSize=14, titlePadding=0\n", + " #).configure_axisX(labelFontSize=14)\n", + " ).configure_axis(\n", + " labelFontSize=12,\n", + " titleFontSize=12\n", + " )\n", + "\n", + "heatmap" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 375 + }, + "id": "Vf8v9OjMku8M", + "outputId": "901a9b29-439c-4fe3-9a53-0a52ad366a94" + }, + "execution_count": 13, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/html": [ + "\n", + "<div id=\"altair-viz-a18ac8bcccb14494af6c01da09381c66\"></div>\n", + "<script type=\"text/javascript\">\n", + " var VEGA_DEBUG = (typeof VEGA_DEBUG == \"undefined\") ? {} : VEGA_DEBUG;\n", + " (function(spec, embedOpt){\n", + " let outputDiv = document.currentScript.previousElementSibling;\n", + " if (outputDiv.id !== \"altair-viz-a18ac8bcccb14494af6c01da09381c66\") {\n", + " outputDiv = document.getElementById(\"altair-viz-a18ac8bcccb14494af6c01da09381c66\");\n", + " }\n", + " const paths = {\n", + " \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n", + " \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n", + " \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.17.0?noext\",\n", + " \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n", + " };\n", + "\n", + " function maybeLoadScript(lib, version) {\n", + " var key = `${lib.replace(\"-\", \"\")}_version`;\n", + " return (VEGA_DEBUG[key] == version) ?\n", + " Promise.resolve(paths[lib]) :\n", + " new Promise(function(resolve, reject) {\n", + " var s = document.createElement('script');\n", + " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", + " s.async = true;\n", + " s.onload = () => {\n", + " VEGA_DEBUG[key] = version;\n", + " return resolve(paths[lib]);\n", + " };\n", + " s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n", + " s.src = paths[lib];\n", + " });\n", + " }\n", + "\n", + " function showError(err) {\n", + " outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n", + " throw err;\n", + " }\n", + "\n", + " function displayChart(vegaEmbed) {\n", + " vegaEmbed(outputDiv, spec, embedOpt)\n", + " .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n", + " }\n", + "\n", + " if(typeof define === \"function\" && define.amd) {\n", + " requirejs.config({paths});\n", + " require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n", + " } else {\n", + " maybeLoadScript(\"vega\", \"5\")\n", + " .then(() => maybeLoadScript(\"vega-lite\", \"4.17.0\"))\n", + " .then(() => maybeLoadScript(\"vega-embed\", \"6\"))\n", + " .catch(showError)\n", + " .then(() => displayChart(vegaEmbed));\n", + " }\n", + " })({\"usermeta\": {\"embedOptions\": {\"theme\": \"dark\"}}, \"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}, \"axis\": {\"labelFontSize\": 12, \"titleFontSize\": 12}}, \"data\": {\"name\": \"data-32bc63e80629128e944e0164825adbe3\"}, \"mark\": \"rect\", \"encoding\": {\"color\": {\"aggregate\": \"max\", \"field\": \"population\", \"legend\": {\"title\": \" \"}, \"scale\": {\"scheme\": \"blueorange\"}, \"type\": \"quantitative\"}, \"stroke\": {\"value\": \"black\"}, \"strokeWidth\": {\"value\": 0.25}, \"x\": {\"axis\": {\"title\": \"States\", \"titleFontSize\": 16, \"titleFontWeight\": 900, \"titlePadding\": 15}, \"field\": \"states\", \"type\": \"ordinal\"}, \"y\": {\"axis\": {\"labelAngle\": 0, \"title\": \"Year\", \"titleFontSize\": 16, \"titleFontWeight\": 900, \"titlePadding\": 15}, \"field\": \"year\", \"type\": \"ordinal\"}}, \"width\": 900, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.17.0.json\", \"datasets\": {\"data-32bc63e80629128e944e0164825adbe3\": [{\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2010, \"population\": 4785437}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2010, \"population\": 713910}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2010, \"population\": 6407172}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2010, \"population\": 2921964}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2010, \"population\": 37319502}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2010, \"population\": 5047349}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2010, \"population\": 3579114}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2010, \"population\": 899593}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2010, \"population\": 605226}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2010, \"population\": 18845537}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2010, \"population\": 9711881}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2010, \"population\": 1363963}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2010, \"population\": 1570746}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2010, \"population\": 12840503}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2010, \"population\": 6490432}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2010, \"population\": 3050745}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2010, \"population\": 2858190}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2010, \"population\": 4348181}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2010, \"population\": 4544532}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2010, \"population\": 1327629}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2010, \"population\": 5788645}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2010, \"population\": 6566307}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2010, \"population\": 9877510}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2010, \"population\": 5310828}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2010, \"population\": 2970548}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2010, \"population\": 5995974}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2010, \"population\": 990697}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2010, \"population\": 1829542}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2010, \"population\": 2702405}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2010, \"population\": 1316762}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2010, \"population\": 8799446}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2010, \"population\": 2064552}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2010, \"population\": 19399878}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2010, \"population\": 9574323}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2010, \"population\": 674715}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2010, \"population\": 11539336}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2010, \"population\": 3759944}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2010, \"population\": 3837491}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2010, \"population\": 12711160}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2010, \"population\": 1053959}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2010, \"population\": 4635649}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2010, \"population\": 816166}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2010, \"population\": 6355311}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2010, \"population\": 25241971}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2010, \"population\": 2775332}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2010, \"population\": 625879}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2010, \"population\": 8023699}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2010, \"population\": 6742830}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2010, \"population\": 1854239}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2010, \"population\": 5690475}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2010, \"population\": 564487}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2010, \"population\": 3721525}, {\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2011, \"population\": 4799069}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2011, \"population\": 722128}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2011, \"population\": 6472643}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2011, \"population\": 2940667}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2011, \"population\": 37638369}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2011, \"population\": 5121108}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2011, \"population\": 3588283}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2011, \"population\": 907381}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2011, \"population\": 619800}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2011, \"population\": 19053237}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2011, \"population\": 9802431}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2011, \"population\": 1379329}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2011, \"population\": 1583910}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2011, \"population\": 12867454}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2011, \"population\": 6516528}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2011, \"population\": 3066336}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2011, \"population\": 2869225}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2011, \"population\": 4369821}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2011, \"population\": 4575625}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2011, \"population\": 1328284}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2011, \"population\": 5839419}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2011, \"population\": 6613583}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2011, \"population\": 9882412}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2011, \"population\": 5346143}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2011, \"population\": 2978731}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2011, \"population\": 6010275}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2011, \"population\": 997316}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2011, \"population\": 1840672}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2011, \"population\": 2712730}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2011, \"population\": 1320202}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2011, \"population\": 8828117}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2011, \"population\": 2080450}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2011, \"population\": 19499241}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2011, \"population\": 9657592}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2011, \"population\": 685225}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2011, \"population\": 11544663}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2011, \"population\": 3788379}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2011, \"population\": 3872036}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2011, \"population\": 12745815}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2011, \"population\": 1053649}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2011, \"population\": 4671994}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2011, \"population\": 823579}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2011, \"population\": 6399291}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2011, \"population\": 25645629}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2011, \"population\": 2814384}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2011, \"population\": 627049}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2011, \"population\": 8101155}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2011, \"population\": 6826627}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2011, \"population\": 1856301}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2011, \"population\": 5705288}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2011, \"population\": 567299}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2011, \"population\": 3678732}, {\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2012, \"population\": 4815588}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2012, \"population\": 730443}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2012, \"population\": 6554978}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2012, \"population\": 2952164}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2012, \"population\": 37948800}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2012, \"population\": 5192647}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2012, \"population\": 3594547}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2012, \"population\": 915179}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2012, \"population\": 634924}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2012, \"population\": 19297822}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2012, \"population\": 9901430}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2012, \"population\": 1394804}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2012, \"population\": 1595324}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2012, \"population\": 12882510}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2012, \"population\": 6537703}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2012, \"population\": 3076190}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2012, \"population\": 2885257}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2012, \"population\": 4386346}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2012, \"population\": 4600972}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2012, \"population\": 1327729}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2012, \"population\": 5886992}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2012, \"population\": 6663005}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2012, \"population\": 9897145}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2012, \"population\": 5376643}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2012, \"population\": 2983816}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2012, \"population\": 6024367}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2012, \"population\": 1003783}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2012, \"population\": 1853303}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2012, \"population\": 2743996}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2012, \"population\": 1324232}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2012, \"population\": 8844942}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2012, \"population\": 2087309}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2012, \"population\": 19572932}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2012, \"population\": 9749476}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2012, \"population\": 701176}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2012, \"population\": 11548923}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2012, \"population\": 3818814}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2012, \"population\": 3899001}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2012, \"population\": 12767118}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2012, \"population\": 1054621}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2012, \"population\": 4717354}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2012, \"population\": 833566}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2012, \"population\": 6453898}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2012, \"population\": 26084481}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2012, \"population\": 2853375}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2012, \"population\": 626090}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2012, \"population\": 8185080}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2012, \"population\": 6897058}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2012, \"population\": 1856872}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2012, \"population\": 5719960}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2012, \"population\": 576305}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2012, \"population\": 3634488}, {\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2013, \"population\": 4830081}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2013, \"population\": 737068}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2013, \"population\": 6632764}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2013, \"population\": 2959400}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2013, \"population\": 38260787}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2013, \"population\": 5269035}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2013, \"population\": 3594841}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2013, \"population\": 923576}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2013, \"population\": 650581}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2013, \"population\": 19545621}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2013, \"population\": 9972479}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2013, \"population\": 1408243}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2013, \"population\": 1611206}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2013, \"population\": 12895129}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2013, \"population\": 6568713}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2013, \"population\": 3092997}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2013, \"population\": 2893212}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2013, \"population\": 4404659}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2013, \"population\": 4624527}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2013, \"population\": 1328009}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2013, \"population\": 5923188}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2013, \"population\": 6713315}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2013, \"population\": 9913065}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2013, \"population\": 5413479}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2013, \"population\": 2988711}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2013, \"population\": 6040715}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2013, \"population\": 1013569}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2013, \"population\": 1865279}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2013, \"population\": 2775970}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2013, \"population\": 1326622}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2013, \"population\": 8856972}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2013, \"population\": 2092273}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2013, \"population\": 19624447}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2013, \"population\": 9843336}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2013, \"population\": 722036}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2013, \"population\": 11576684}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2013, \"population\": 3853214}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2013, \"population\": 3922468}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2013, \"population\": 12776309}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2013, \"population\": 1055081}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2013, \"population\": 4764080}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2013, \"population\": 842316}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2013, \"population\": 6494340}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2013, \"population\": 26480266}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2013, \"population\": 2897640}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2013, \"population\": 626210}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2013, \"population\": 8252427}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2013, \"population\": 6963985}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2013, \"population\": 1853914}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2013, \"population\": 5736754}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2013, \"population\": 582122}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2013, \"population\": 3593077}, {\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2014, \"population\": 4841799}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2014, \"population\": 736283}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2014, \"population\": 6730413}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2014, \"population\": 2967392}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2014, \"population\": 38596972}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2014, \"population\": 5350101}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2014, \"population\": 3594524}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2014, \"population\": 932487}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2014, \"population\": 662328}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2014, \"population\": 19845911}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2014, \"population\": 10067278}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2014, \"population\": 1414538}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2014, \"population\": 1631112}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2014, \"population\": 12884493}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2014, \"population\": 6593644}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2014, \"population\": 3109350}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2014, \"population\": 2900475}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2014, \"population\": 4414349}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2014, \"population\": 4644013}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2014, \"population\": 1330513}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2014, \"population\": 5957283}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2014, \"population\": 6762596}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2014, \"population\": 9929848}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2014, \"population\": 5451079}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2014, \"population\": 2990468}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2014, \"population\": 6056202}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2014, \"population\": 1021869}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2014, \"population\": 1879321}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2014, \"population\": 2817628}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2014, \"population\": 1333341}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2014, \"population\": 8864525}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2014, \"population\": 2089568}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2014, \"population\": 19651049}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2014, \"population\": 9932887}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2014, \"population\": 737401}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2014, \"population\": 11602700}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2014, \"population\": 3878187}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2014, \"population\": 3963244}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2014, \"population\": 12788313}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2014, \"population\": 1055936}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2014, \"population\": 4823617}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2014, \"population\": 849129}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2014, \"population\": 6541223}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2014, \"population\": 26964333}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2014, \"population\": 2936879}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2014, \"population\": 625214}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2014, \"population\": 8310993}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2014, \"population\": 7054655}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2014, \"population\": 1849489}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2014, \"population\": 5751525}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2014, \"population\": 582531}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2014, \"population\": 3534874}, {\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2015, \"population\": 4852347}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2015, \"population\": 737498}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2015, \"population\": 6829676}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2015, \"population\": 2978048}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2015, \"population\": 38918045}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2015, \"population\": 5450623}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2015, \"population\": 3587122}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2015, \"population\": 941252}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2015, \"population\": 675400}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2015, \"population\": 20209042}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2015, \"population\": 10178447}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2015, \"population\": 1422052}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2015, \"population\": 1651059}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2015, \"population\": 12858913}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2015, \"population\": 6608422}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2015, \"population\": 3120960}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2015, \"population\": 2909011}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2015, \"population\": 4425976}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2015, \"population\": 4664628}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2015, \"population\": 1328262}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2015, \"population\": 5985562}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2015, \"population\": 6794228}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2015, \"population\": 9931715}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2015, \"population\": 5482032}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2015, \"population\": 2988471}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2015, \"population\": 6071732}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2015, \"population\": 1030475}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2015, \"population\": 1891277}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2015, \"population\": 2866939}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2015, \"population\": 1336350}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2015, \"population\": 8867949}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2015, \"population\": 2089291}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2015, \"population\": 19654666}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2015, \"population\": 10031646}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2015, \"population\": 754066}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2015, \"population\": 11617527}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2015, \"population\": 3909500}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2015, \"population\": 4015792}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2015, \"population\": 12784826}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2015, \"population\": 1056065}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2015, \"population\": 4891938}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2015, \"population\": 853988}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2015, \"population\": 6591170}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2015, \"population\": 27470056}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2015, \"population\": 2981835}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2015, \"population\": 625216}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2015, \"population\": 8361808}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2015, \"population\": 7163657}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2015, \"population\": 1842050}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2015, \"population\": 5760940}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2015, \"population\": 585613}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2015, \"population\": 3473232}, {\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2016, \"population\": 4863525}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2016, \"population\": 741456}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2016, \"population\": 6941072}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2016, \"population\": 2989918}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2016, \"population\": 39167117}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2016, \"population\": 5539215}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2016, \"population\": 3578141}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2016, \"population\": 948921}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2016, \"population\": 685815}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2016, \"population\": 20613477}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2016, \"population\": 10301890}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2016, \"population\": 1427559}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2016, \"population\": 1682380}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2016, \"population\": 12820527}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2016, \"population\": 6634304}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2016, \"population\": 3131371}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2016, \"population\": 2910844}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2016, \"population\": 4438182}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2016, \"population\": 4678135}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2016, \"population\": 1331317}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2016, \"population\": 6003323}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2016, \"population\": 6823608}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2016, \"population\": 9950571}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2016, \"population\": 5522744}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2016, \"population\": 2987938}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2016, \"population\": 6087135}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2016, \"population\": 1040859}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2016, \"population\": 1905616}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2016, \"population\": 2917563}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2016, \"population\": 1342307}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2016, \"population\": 8870827}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2016, \"population\": 2091630}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2016, \"population\": 19633428}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2016, \"population\": 10154788}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2016, \"population\": 754434}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2016, \"population\": 11634370}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2016, \"population\": 3926331}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2016, \"population\": 4089976}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2016, \"population\": 12782275}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2016, \"population\": 1056770}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2016, \"population\": 4957968}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2016, \"population\": 862996}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2016, \"population\": 6646010}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2016, \"population\": 27914410}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2016, \"population\": 3041868}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2016, \"population\": 623657}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2016, \"population\": 8410106}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2016, \"population\": 7294771}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2016, \"population\": 1831023}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2016, \"population\": 5772628}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2016, \"population\": 584215}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2016, \"population\": 3406672}, {\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2017, \"population\": 4874486}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2017, \"population\": 739700}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2017, \"population\": 7044008}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2017, \"population\": 3001345}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2017, \"population\": 39358497}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2017, \"population\": 5611885}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2017, \"population\": 3573297}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2017, \"population\": 956823}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2017, \"population\": 694906}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2017, \"population\": 20963613}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2017, \"population\": 10410330}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2017, \"population\": 1424393}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2017, \"population\": 1717715}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2017, \"population\": 12778828}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2017, \"population\": 6658078}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2017, \"population\": 3141550}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2017, \"population\": 2908718}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2017, \"population\": 4452268}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2017, \"population\": 4670560}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2017, \"population\": 1334612}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2017, \"population\": 6023868}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2017, \"population\": 6859789}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2017, \"population\": 9973114}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2017, \"population\": 5566230}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2017, \"population\": 2988510}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2017, \"population\": 6106670}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2017, \"population\": 1052482}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2017, \"population\": 1915947}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2017, \"population\": 2969905}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2017, \"population\": 1348787}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2017, \"population\": 8885525}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2017, \"population\": 2091784}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2017, \"population\": 19589572}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2017, \"population\": 10268233}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2017, \"population\": 754942}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2017, \"population\": 11659650}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2017, \"population\": 3931316}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2017, \"population\": 4143625}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2017, \"population\": 12787641}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2017, \"population\": 1055673}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2017, \"population\": 5021268}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2017, \"population\": 872868}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2017, \"population\": 6708799}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2017, \"population\": 28295273}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2017, \"population\": 3101042}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2017, \"population\": 624344}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2017, \"population\": 8463587}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2017, \"population\": 7423362}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2017, \"population\": 1817004}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2017, \"population\": 5790186}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2017, \"population\": 578931}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2017, \"population\": 3325286}, {\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2018, \"population\": 4887681}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2018, \"population\": 735139}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2018, \"population\": 7158024}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2018, \"population\": 3009733}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2018, \"population\": 39461588}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2018, \"population\": 5691287}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2018, \"population\": 3571520}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2018, \"population\": 965479}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2018, \"population\": 701547}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2018, \"population\": 21244317}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2018, \"population\": 10511131}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2018, \"population\": 1420593}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2018, \"population\": 1750536}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2018, \"population\": 12723071}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2018, \"population\": 6695497}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2018, \"population\": 3148618}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2018, \"population\": 2911359}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2018, \"population\": 4461153}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2018, \"population\": 4659690}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2018, \"population\": 1339057}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2018, \"population\": 6035802}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2018, \"population\": 6882635}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2018, \"population\": 9984072}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2018, \"population\": 5606249}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2018, \"population\": 2981020}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2018, \"population\": 6121623}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2018, \"population\": 1060665}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2018, \"population\": 1925614}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2018, \"population\": 3027341}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2018, \"population\": 1353465}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2018, \"population\": 8886025}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2018, \"population\": 2092741}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2018, \"population\": 19530351}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2018, \"population\": 10381615}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2018, \"population\": 758080}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2018, \"population\": 11676341}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2018, \"population\": 3940235}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2018, \"population\": 4181886}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2018, \"population\": 12800922}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2018, \"population\": 1058287}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2018, \"population\": 5084156}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2018, \"population\": 878698}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2018, \"population\": 6771631}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2018, \"population\": 28628666}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2018, \"population\": 3153550}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2018, \"population\": 624358}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2018, \"population\": 8501286}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2018, \"population\": 7523869}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2018, \"population\": 1804291}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2018, \"population\": 5807406}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2018, \"population\": 577601}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2018, \"population\": 3193354}, {\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2019, \"population\": 4903185}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2019, \"population\": 731545}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2019, \"population\": 7278717}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2019, \"population\": 3017804}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2019, \"population\": 39512223}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2019, \"population\": 5758736}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2019, \"population\": 3565287}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2019, \"population\": 973764}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2019, \"population\": 705749}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2019, \"population\": 21477737}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2019, \"population\": 10617423}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2019, \"population\": 1415872}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2019, \"population\": 1787065}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2019, \"population\": 12671821}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2019, \"population\": 6732219}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2019, \"population\": 3155070}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2019, \"population\": 2913314}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2019, \"population\": 4467673}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2019, \"population\": 4648794}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2019, \"population\": 1344212}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2019, \"population\": 6045680}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2019, \"population\": 6892503}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2019, \"population\": 9986857}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2019, \"population\": 5639632}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2019, \"population\": 2976149}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2019, \"population\": 6137428}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2019, \"population\": 1068778}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2019, \"population\": 1934408}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2019, \"population\": 3080156}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2019, \"population\": 1359711}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2019, \"population\": 8882190}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2019, \"population\": 2096829}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2019, \"population\": 19453561}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2019, \"population\": 10488084}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2019, \"population\": 762062}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2019, \"population\": 11689100}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2019, \"population\": 3956971}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2019, \"population\": 4217737}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2019, \"population\": 12801989}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2019, \"population\": 1059361}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2019, \"population\": 5148714}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2019, \"population\": 884659}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2019, \"population\": 6829174}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2019, \"population\": 28995881}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2019, \"population\": 3205958}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2019, \"population\": 623989}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2019, \"population\": 8535519}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2019, \"population\": 7614893}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2019, \"population\": 1792147}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2019, \"population\": 5822434}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2019, \"population\": 578759}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2019, \"population\": 3193694}]}}, {\"mode\": \"vega-lite\"});\n", + "</script>" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "metadata": {}, + "execution_count": 13 + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Choropleth" + ], + "metadata": { + "id": "69oYy6edR4V7" + } + }, + { + "cell_type": "code", + "source": [ + "# Choropleth via Altair\n", + "import altair as alt\n", + "from vega_datasets import data\n", + "\n", + "alt.themes.enable(\"dark\")\n", + "\n", + "states = alt.topo_feature(data.us_10m.url, 'states')\n", + "\n", + "alt.Chart(states).mark_geoshape().encode(\n", + " color=alt.Color('population:Q', scale=alt.Scale(scheme='blues')), # scale=color_scale\n", + " stroke=alt.value('#154360')\n", + ").transform_lookup(\n", + " lookup='id',\n", + " from_=alt.LookupData(df_selected_year, 'id', list(df_selected_year.columns))\n", + ").properties(\n", + " width=500,\n", + " height=300\n", + ").project(\n", + " type='albersUsa'\n", + ")\n", + "\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 331 + }, + "id": "rCT-THXqdc2e", + "outputId": "ef2d0b90-45d8-496c-8176-96fba73623b6" + }, + "execution_count": 18, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/html": [ + "\n", + "<div id=\"altair-viz-fbc1c897e3b541e6a7657e079541313a\"></div>\n", + "<script type=\"text/javascript\">\n", + " var VEGA_DEBUG = (typeof VEGA_DEBUG == \"undefined\") ? {} : VEGA_DEBUG;\n", + " (function(spec, embedOpt){\n", + " let outputDiv = document.currentScript.previousElementSibling;\n", + " if (outputDiv.id !== \"altair-viz-fbc1c897e3b541e6a7657e079541313a\") {\n", + " outputDiv = document.getElementById(\"altair-viz-fbc1c897e3b541e6a7657e079541313a\");\n", + " }\n", + " const paths = {\n", + " \"vega\": \"https://cdn.jsdelivr.net/npm//vega@5?noext\",\n", + " \"vega-lib\": \"https://cdn.jsdelivr.net/npm//vega-lib?noext\",\n", + " \"vega-lite\": \"https://cdn.jsdelivr.net/npm//vega-lite@4.17.0?noext\",\n", + " \"vega-embed\": \"https://cdn.jsdelivr.net/npm//vega-embed@6?noext\",\n", + " };\n", + "\n", + " function maybeLoadScript(lib, version) {\n", + " var key = `${lib.replace(\"-\", \"\")}_version`;\n", + " return (VEGA_DEBUG[key] == version) ?\n", + " Promise.resolve(paths[lib]) :\n", + " new Promise(function(resolve, reject) {\n", + " var s = document.createElement('script');\n", + " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", + " s.async = true;\n", + " s.onload = () => {\n", + " VEGA_DEBUG[key] = version;\n", + " return resolve(paths[lib]);\n", + " };\n", + " s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n", + " s.src = paths[lib];\n", + " });\n", + " }\n", + "\n", + " function showError(err) {\n", + " outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n", + " throw err;\n", + " }\n", + "\n", + " function displayChart(vegaEmbed) {\n", + " vegaEmbed(outputDiv, spec, embedOpt)\n", + " .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n", + " }\n", + "\n", + " if(typeof define === \"function\" && define.amd) {\n", + " requirejs.config({paths});\n", + " require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n", + " } else {\n", + " maybeLoadScript(\"vega\", \"5\")\n", + " .then(() => maybeLoadScript(\"vega-lite\", \"4.17.0\"))\n", + " .then(() => maybeLoadScript(\"vega-embed\", \"6\"))\n", + " .catch(showError)\n", + " .then(() => displayChart(vegaEmbed));\n", + " }\n", + " })({\"usermeta\": {\"embedOptions\": {\"theme\": \"dark\"}}, \"config\": {\"view\": {\"continuousWidth\": 400, \"continuousHeight\": 300}}, \"data\": {\"url\": \"https://cdn.jsdelivr.net/npm/vega-datasets@v1.29.0/data/us-10m.json\", \"format\": {\"feature\": \"states\", \"type\": \"topojson\"}}, \"mark\": \"geoshape\", \"encoding\": {\"color\": {\"field\": \"population\", \"scale\": {\"scheme\": \"blues\"}, \"type\": \"quantitative\"}, \"stroke\": {\"value\": \"#154360\"}}, \"height\": 300, \"projection\": {\"type\": \"albersUsa\"}, \"transform\": [{\"lookup\": \"id\", \"from\": {\"data\": {\"name\": \"data-86ac736860a3570161e624b76a6dbcbe\"}, \"key\": \"id\", \"fields\": [\"states\", \"states_code\", \"id\", \"year\", \"population\"]}}], \"width\": 500, \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.17.0.json\", \"datasets\": {\"data-86ac736860a3570161e624b76a6dbcbe\": [{\"states\": \"Alabama\", \"states_code\": \"AL\", \"id\": 1, \"year\": 2019, \"population\": 4903185}, {\"states\": \"Alaska\", \"states_code\": \"AK\", \"id\": 2, \"year\": 2019, \"population\": 731545}, {\"states\": \"Arizona\", \"states_code\": \"AZ\", \"id\": 4, \"year\": 2019, \"population\": 7278717}, {\"states\": \"Arkansas\", \"states_code\": \"AR\", \"id\": 5, \"year\": 2019, \"population\": 3017804}, {\"states\": \"California\", \"states_code\": \"CA\", \"id\": 6, \"year\": 2019, \"population\": 39512223}, {\"states\": \"Colorado\", \"states_code\": \"CO\", \"id\": 8, \"year\": 2019, \"population\": 5758736}, {\"states\": \"Connecticut\", \"states_code\": \"CT\", \"id\": 9, \"year\": 2019, \"population\": 3565287}, {\"states\": \"Delaware\", \"states_code\": \"DE\", \"id\": 10, \"year\": 2019, \"population\": 973764}, {\"states\": \"District of Columbia\", \"states_code\": \"DC\", \"id\": 11, \"year\": 2019, \"population\": 705749}, {\"states\": \"Florida\", \"states_code\": \"FL\", \"id\": 12, \"year\": 2019, \"population\": 21477737}, {\"states\": \"Georgia\", \"states_code\": \"GA\", \"id\": 13, \"year\": 2019, \"population\": 10617423}, {\"states\": \"Hawaii\", \"states_code\": \"HI\", \"id\": 15, \"year\": 2019, \"population\": 1415872}, {\"states\": \"Idaho\", \"states_code\": \"ID\", \"id\": 16, \"year\": 2019, \"population\": 1787065}, {\"states\": \"Illinois\", \"states_code\": \"IL\", \"id\": 17, \"year\": 2019, \"population\": 12671821}, {\"states\": \"Indiana\", \"states_code\": \"IN\", \"id\": 18, \"year\": 2019, \"population\": 6732219}, {\"states\": \"Iowa\", \"states_code\": \"IA\", \"id\": 19, \"year\": 2019, \"population\": 3155070}, {\"states\": \"Kansas\", \"states_code\": \"KS\", \"id\": 20, \"year\": 2019, \"population\": 2913314}, {\"states\": \"Kentucky\", \"states_code\": \"KY\", \"id\": 21, \"year\": 2019, \"population\": 4467673}, {\"states\": \"Louisiana\", \"states_code\": \"LA\", \"id\": 22, \"year\": 2019, \"population\": 4648794}, {\"states\": \"Maine\", \"states_code\": \"ME\", \"id\": 23, \"year\": 2019, \"population\": 1344212}, {\"states\": \"Maryland\", \"states_code\": \"MD\", \"id\": 24, \"year\": 2019, \"population\": 6045680}, {\"states\": \"Massachusetts\", \"states_code\": \"MA\", \"id\": 25, \"year\": 2019, \"population\": 6892503}, {\"states\": \"Michigan\", \"states_code\": \"MI\", \"id\": 26, \"year\": 2019, \"population\": 9986857}, {\"states\": \"Minnesota\", \"states_code\": \"MN\", \"id\": 27, \"year\": 2019, \"population\": 5639632}, {\"states\": \"Mississippi\", \"states_code\": \"MS\", \"id\": 28, \"year\": 2019, \"population\": 2976149}, {\"states\": \"Missouri\", \"states_code\": \"MO\", \"id\": 29, \"year\": 2019, \"population\": 6137428}, {\"states\": \"Montana\", \"states_code\": \"MT\", \"id\": 30, \"year\": 2019, \"population\": 1068778}, {\"states\": \"Nebraska\", \"states_code\": \"NE\", \"id\": 31, \"year\": 2019, \"population\": 1934408}, {\"states\": \"Nevada\", \"states_code\": \"NV\", \"id\": 32, \"year\": 2019, \"population\": 3080156}, {\"states\": \"New Hampshire\", \"states_code\": \"NH\", \"id\": 33, \"year\": 2019, \"population\": 1359711}, {\"states\": \"New Jersey\", \"states_code\": \"NJ\", \"id\": 34, \"year\": 2019, \"population\": 8882190}, {\"states\": \"New Mexico\", \"states_code\": \"NM\", \"id\": 35, \"year\": 2019, \"population\": 2096829}, {\"states\": \"New York\", \"states_code\": \"NY\", \"id\": 36, \"year\": 2019, \"population\": 19453561}, {\"states\": \"North Carolina\", \"states_code\": \"NC\", \"id\": 37, \"year\": 2019, \"population\": 10488084}, {\"states\": \"North Dakota\", \"states_code\": \"ND\", \"id\": 38, \"year\": 2019, \"population\": 762062}, {\"states\": \"Ohio\", \"states_code\": \"OH\", \"id\": 39, \"year\": 2019, \"population\": 11689100}, {\"states\": \"Oklahoma\", \"states_code\": \"OK\", \"id\": 40, \"year\": 2019, \"population\": 3956971}, {\"states\": \"Oregon\", \"states_code\": \"OR\", \"id\": 41, \"year\": 2019, \"population\": 4217737}, {\"states\": \"Pennsylvania\", \"states_code\": \"PA\", \"id\": 42, \"year\": 2019, \"population\": 12801989}, {\"states\": \"Rhode Island\", \"states_code\": \"RI\", \"id\": 44, \"year\": 2019, \"population\": 1059361}, {\"states\": \"South Carolina\", \"states_code\": \"SC\", \"id\": 45, \"year\": 2019, \"population\": 5148714}, {\"states\": \"South Dakota\", \"states_code\": \"SD\", \"id\": 46, \"year\": 2019, \"population\": 884659}, {\"states\": \"Tennessee\", \"states_code\": \"TN\", \"id\": 47, \"year\": 2019, \"population\": 6829174}, {\"states\": \"Texas\", \"states_code\": \"TX\", \"id\": 48, \"year\": 2019, \"population\": 28995881}, {\"states\": \"Utah\", \"states_code\": \"UT\", \"id\": 49, \"year\": 2019, \"population\": 3205958}, {\"states\": \"Vermont\", \"states_code\": \"VT\", \"id\": 50, \"year\": 2019, \"population\": 623989}, {\"states\": \"Virginia\", \"states_code\": \"VA\", \"id\": 51, \"year\": 2019, \"population\": 8535519}, {\"states\": \"Washington\", \"states_code\": \"WA\", \"id\": 53, \"year\": 2019, \"population\": 7614893}, {\"states\": \"West Virginia\", \"states_code\": \"WV\", \"id\": 54, \"year\": 2019, \"population\": 1792147}, {\"states\": \"Wisconsin\", \"states_code\": \"WI\", \"id\": 55, \"year\": 2019, \"population\": 5822434}, {\"states\": \"Wyoming\", \"states_code\": \"WY\", \"id\": 56, \"year\": 2019, \"population\": 578759}, {\"states\": \"Puerto Rico\", \"states_code\": \"PR\", \"id\": 72, \"year\": 2019, \"population\": 3193694}]}}, {\"mode\": \"vega-lite\"});\n", + "</script>" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "metadata": {}, + "execution_count": 18 + } + ] + }, + { + "cell_type": "code", + "source": [ + "# Choropleth via Plotly\n", + "import plotly.express as px\n", + "\n", + "choropleth = px.choropleth(df_selected_year, locations='states_code', color='population', locationmode=\"USA-states\",\n", + " color_continuous_scale='blues',\n", + " range_color=(0, max(df_selected_year.population)),\n", + " scope=\"usa\",\n", + " labels={'population':'Population'}\n", + " )\n", + "choropleth.update_layout(\n", + " template='plotly_dark',\n", + " plot_bgcolor='rgba(0, 0, 0, 0)',\n", + " paper_bgcolor='rgba(0, 0, 0, 0)',\n", + " margin=dict(l=0, r=0, t=0, b=0),\n", + " height=350\n", + " )\n", + "\n", + "choropleth" + ], + "metadata": { + "id": "2_eE7AyrQ3gR", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 367 + }, + "outputId": "6a49cc4c-0424-4a32-ea5e-b140734ead71" + }, + "execution_count": 17, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/html": [ + "<html>\n", + "<head><meta charset=\"utf-8\" /></head>\n", + "<body>\n", + " <div> <script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG\"></script><script type=\"text/javascript\">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}</script> <script type=\"text/javascript\">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n", + " <script charset=\"utf-8\" src=\"https://cdn.plot.ly/plotly-2.24.1.min.js\"></script> <div id=\"3e25d7b2-e382-40f5-92b6-b0b9257f8c58\" class=\"plotly-graph-div\" style=\"height:350px; width:100%;\"></div> <script type=\"text/javascript\"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"3e25d7b2-e382-40f5-92b6-b0b9257f8c58\")) { Plotly.newPlot( \"3e25d7b2-e382-40f5-92b6-b0b9257f8c58\", [{\"coloraxis\":\"coloraxis\",\"geo\":\"geo\",\"hovertemplate\":\"states_code=%{location}\\u003cbr\\u003ePopulation=%{z}\\u003cextra\\u003e\\u003c\\u002fextra\\u003e\",\"locationmode\":\"USA-states\",\"locations\":[\"AL\",\"AK\",\"AZ\",\"AR\",\"CA\",\"CO\",\"CT\",\"DE\",\"DC\",\"FL\",\"GA\",\"HI\",\"ID\",\"IL\",\"IN\",\"IA\",\"KS\",\"KY\",\"LA\",\"ME\",\"MD\",\"MA\",\"MI\",\"MN\",\"MS\",\"MO\",\"MT\",\"NE\",\"NV\",\"NH\",\"NJ\",\"NM\",\"NY\",\"NC\",\"ND\",\"OH\",\"OK\",\"OR\",\"PA\",\"RI\",\"SC\",\"SD\",\"TN\",\"TX\",\"UT\",\"VT\",\"VA\",\"WA\",\"WV\",\"WI\",\"WY\",\"PR\"],\"name\":\"\",\"z\":[4903185,731545,7278717,3017804,39512223,5758736,3565287,973764,705749,21477737,10617423,1415872,1787065,12671821,6732219,3155070,2913314,4467673,4648794,1344212,6045680,6892503,9986857,5639632,2976149,6137428,1068778,1934408,3080156,1359711,8882190,2096829,19453561,10488084,762062,11689100,3956971,4217737,12801989,1059361,5148714,884659,6829174,28995881,3205958,623989,8535519,7614893,1792147,5822434,578759,3193694],\"type\":\"choropleth\"}], {\"template\":{\"data\":{\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgb(17,17,17)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"bar\":[{\"error_x\":{\"color\":\"#f2f5fa\"},\"error_y\":{\"color\":\"#f2f5fa\"},\"marker\":{\"line\":{\"color\":\"rgb(17,17,17)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#A2B1C6\",\"gridcolor\":\"#506784\",\"linecolor\":\"#506784\",\"minorgridcolor\":\"#506784\",\"startlinecolor\":\"#A2B1C6\"},\"baxis\":{\"endlinecolor\":\"#A2B1C6\",\"gridcolor\":\"#506784\",\"linecolor\":\"#506784\",\"minorgridcolor\":\"#506784\",\"startlinecolor\":\"#A2B1C6\"},\"type\":\"carpet\"}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"type\":\"choropleth\"}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"type\":\"contourcarpet\"}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"contour\"}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"heatmapgl\"}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"heatmap\"}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"histogram2dcontour\"}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"histogram2d\"}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"type\":\"mesh3d\"}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"parcoords\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}],\"scatter3d\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scatter3d\"}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scattercarpet\"}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scattergeo\"}],\"scattergl\":[{\"marker\":{\"line\":{\"color\":\"#283442\"}},\"type\":\"scattergl\"}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scattermapbox\"}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scatterpolargl\"}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scatterpolar\"}],\"scatter\":[{\"marker\":{\"line\":{\"color\":\"#283442\"}},\"type\":\"scatter\"}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"type\":\"scatterternary\"}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"type\":\"surface\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#506784\"},\"line\":{\"color\":\"rgb(17,17,17)\"}},\"header\":{\"fill\":{\"color\":\"#2a3f5f\"},\"line\":{\"color\":\"rgb(17,17,17)\"}},\"type\":\"table\"}]},\"layout\":{\"annotationdefaults\":{\"arrowcolor\":\"#f2f5fa\",\"arrowhead\":0,\"arrowwidth\":1},\"autotypenumbers\":\"strict\",\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]],\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]},\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#f2f5fa\"},\"geo\":{\"bgcolor\":\"rgb(17,17,17)\",\"lakecolor\":\"rgb(17,17,17)\",\"landcolor\":\"rgb(17,17,17)\",\"showlakes\":true,\"showland\":true,\"subunitcolor\":\"#506784\"},\"hoverlabel\":{\"align\":\"left\"},\"hovermode\":\"closest\",\"mapbox\":{\"style\":\"dark\"},\"paper_bgcolor\":\"rgb(17,17,17)\",\"plot_bgcolor\":\"rgb(17,17,17)\",\"polar\":{\"angularaxis\":{\"gridcolor\":\"#506784\",\"linecolor\":\"#506784\",\"ticks\":\"\"},\"bgcolor\":\"rgb(17,17,17)\",\"radialaxis\":{\"gridcolor\":\"#506784\",\"linecolor\":\"#506784\",\"ticks\":\"\"}},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"rgb(17,17,17)\",\"gridcolor\":\"#506784\",\"gridwidth\":2,\"linecolor\":\"#506784\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"#C8D4E3\"},\"yaxis\":{\"backgroundcolor\":\"rgb(17,17,17)\",\"gridcolor\":\"#506784\",\"gridwidth\":2,\"linecolor\":\"#506784\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"#C8D4E3\"},\"zaxis\":{\"backgroundcolor\":\"rgb(17,17,17)\",\"gridcolor\":\"#506784\",\"gridwidth\":2,\"linecolor\":\"#506784\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"#C8D4E3\"}},\"shapedefaults\":{\"line\":{\"color\":\"#f2f5fa\"}},\"sliderdefaults\":{\"bgcolor\":\"#C8D4E3\",\"bordercolor\":\"rgb(17,17,17)\",\"borderwidth\":1,\"tickwidth\":0},\"ternary\":{\"aaxis\":{\"gridcolor\":\"#506784\",\"linecolor\":\"#506784\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"#506784\",\"linecolor\":\"#506784\",\"ticks\":\"\"},\"bgcolor\":\"rgb(17,17,17)\",\"caxis\":{\"gridcolor\":\"#506784\",\"linecolor\":\"#506784\",\"ticks\":\"\"}},\"title\":{\"x\":0.05},\"updatemenudefaults\":{\"bgcolor\":\"#506784\",\"borderwidth\":0},\"xaxis\":{\"automargin\":true,\"gridcolor\":\"#283442\",\"linecolor\":\"#506784\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"#283442\",\"zerolinewidth\":2},\"yaxis\":{\"automargin\":true,\"gridcolor\":\"#283442\",\"linecolor\":\"#506784\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"#283442\",\"zerolinewidth\":2}}},\"geo\":{\"domain\":{\"x\":[0.0,1.0],\"y\":[0.0,1.0]},\"center\":{},\"scope\":\"usa\"},\"coloraxis\":{\"colorbar\":{\"title\":{\"text\":\"Population\"}},\"colorscale\":[[0.0,\"rgb(247,251,255)\"],[0.125,\"rgb(222,235,247)\"],[0.25,\"rgb(198,219,239)\"],[0.375,\"rgb(158,202,225)\"],[0.5,\"rgb(107,174,214)\"],[0.625,\"rgb(66,146,198)\"],[0.75,\"rgb(33,113,181)\"],[0.875,\"rgb(8,81,156)\"],[1.0,\"rgb(8,48,107)\"]],\"cmin\":0,\"cmax\":39512223},\"legend\":{\"tracegroupgap\":0},\"margin\":{\"t\":0,\"l\":0,\"r\":0,\"b\":0},\"plot_bgcolor\":\"rgba(0, 0, 0, 0)\",\"paper_bgcolor\":\"rgba(0, 0, 0, 0)\",\"height\":350}, {\"responsive\": true} ).then(function(){\n", + " \n", + "var gd = document.getElementById('3e25d7b2-e382-40f5-92b6-b0b9257f8c58');\n", + "var x = new MutationObserver(function (mutations, observer) {{\n", + " var display = window.getComputedStyle(gd).display;\n", + " if (!display || display === 'none') {{\n", + " console.log([gd, 'removed!']);\n", + " Plotly.purge(gd);\n", + " observer.disconnect();\n", + " }}\n", + "}});\n", + "\n", + "// Listen for the removal of the full notebook cells\n", + "var notebookContainer = gd.closest('#notebook-container');\n", + "if (notebookContainer) {{\n", + " x.observe(notebookContainer, {childList: true});\n", + "}}\n", + "\n", + "// Listen for the clearing of the current output cell\n", + "var outputEl = gd.closest('.output');\n", + "if (outputEl) {{\n", + " x.observe(outputEl, {childList: true});\n", + "}}\n", + "\n", + " }) }; </script> </div>\n", + "</body>\n", + "</html>" + ] + }, + "metadata": {} + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "4pA42QK1LURE" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file