├── .gitignore ├── .ipynb_checkpoints └── pandas-checkpoint.ipynb ├── datasets ├── calories.csv ├── countries-data.json ├── exercise.csv └── weight-height.csv ├── favicon ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico └── site.webmanifest ├── images ├── Pandas.png ├── icon.PNG ├── pandas-dataframe-1.png ├── pandas-dataframe-2.png ├── pandas-series-1.png ├── pandas-series-2.png └── pandas-series-3.png ├── index.html ├── pandas.ipynb └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | .ipynb_checkpoints -------------------------------------------------------------------------------- /.ipynb_checkpoints/pandas-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## Pandas\n", 8 | "\n", 9 | "Pandas is an open source, high-performance, easy-to-use data structures and data analysis Python library.\n", 10 | "Pandas adds data structures and tools designed to work with table-like data which is *Series* and *Data Frames*.\n", 11 | "Pandas provides tools for data manipulation: \n", 12 | "\n", 13 | "- cleaning\n", 14 | "- exploring\n", 15 | "- analysing\n", 16 | "- reshaping\n", 17 | "- merging\n", 18 | "- sorting\n", 19 | "- slicing\n", 20 | "- aggregation\n", 21 | "- imputation\n", 22 | "\n", 23 | "If you are using anaconda, you do not have install pandas." 24 | ] 25 | }, 26 | { 27 | "cell_type": "markdown", 28 | "metadata": {}, 29 | "source": [ 30 | "### Installing Pandas\n", 31 | "\n", 32 | "For Mac:\n", 33 | "```py\n", 34 | "pip install conda\n", 35 | "conda install pandas\n", 36 | "```\n", 37 | "\n", 38 | "For Windows:\n", 39 | "```py\n", 40 | "pip install conda\n", 41 | "pip install pandas\n", 42 | "```\n", 43 | "\n", 44 | "Pandas data structure is based on *Series* and *DataFrames*. \n", 45 | "\n", 46 | "A *series* is a *column* and a DataFrame is a *multidimensional table* made up of collection of *series*. In order to create a pandas series we should use numpy to create a one dimensional arrays or a python list.\n", 47 | "Let us see an example of a series:\n", 48 | "\n", 49 | "Names Pandas Series" 50 | ] 51 | }, 52 | { 53 | "cell_type": "markdown", 54 | "metadata": {}, 55 | "source": [ 56 | "Names Pandas Series\n", 57 | "\n", 58 | "![pandas series](./images/pandas-series-1.png) \n", 59 | "\n", 60 | "Countries Series\n", 61 | "\n", 62 | "![pandas series](./images/pandas-series-2.png) \n", 63 | "\n", 64 | "Cities Series\n", 65 | "\n", 66 | "![pandas series](./images/pandas-series-3.png)\n", 67 | "\n", 68 | "As you can see, pandas series is just one column of data. If we want to have multiple columns we use data frames. The example below shows pandas DataFrames.\n", 69 | "\n", 70 | "Let us see, an example of a pandas data frame:\n", 71 | "\n", 72 | "![Pandas data frame](./images/pandas-dataframe-1.png)\n", 73 | "\n", 74 | "Data frame is a collection of rows and columns. Look at the table below; it has many more columns than the example above:\n", 75 | "\n", 76 | "![Pandas data frame](./images/pandas-dataframe-2.png)\n", 77 | "\n", 78 | "Next, we will see how to import pandas and how to create Series and DataFrames using pandas\n" 79 | ] 80 | }, 81 | { 82 | "cell_type": "markdown", 83 | "metadata": {}, 84 | "source": [ 85 | "### Importing Pandas\n", 86 | "\n", 87 | "```python\n", 88 | "import pandas as pd # importing pandas as pd\n", 89 | "import numpy as np # importing numpy as np\n", 90 | "```" 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "execution_count": 400, 96 | "metadata": {}, 97 | "outputs": [], 98 | "source": [ 99 | "import pandas as pd # importing pandas as pd\n", 100 | "import numpy as np # importing numpy as np" 101 | ] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": 401, 106 | "metadata": {}, 107 | "outputs": [], 108 | "source": [ 109 | "### Pandas Version" 110 | ] 111 | }, 112 | { 113 | "cell_type": "code", 114 | "execution_count": 402, 115 | "metadata": {}, 116 | "outputs": [ 117 | { 118 | "data": { 119 | "text/plain": [ 120 | "'1.1.3'" 121 | ] 122 | }, 123 | "execution_count": 402, 124 | "metadata": {}, 125 | "output_type": "execute_result" 126 | } 127 | ], 128 | "source": [ 129 | "pd.__version__" 130 | ] 131 | }, 132 | { 133 | "cell_type": "code", 134 | "execution_count": 415, 135 | "metadata": {}, 136 | "outputs": [ 137 | { 138 | "name": "stdout", 139 | "output_type": "stream", 140 | "text": [ 141 | "0 1\n", 142 | "1 2\n", 143 | "2 3\n", 144 | "3 4\n", 145 | "4 5\n", 146 | "dtype: int64\n" 147 | ] 148 | } 149 | ], 150 | "source": [ 151 | "nums = [1, 2, 3, 4,5]\n", 152 | "s = pd.Series(nums)\n", 153 | "print(s)" 154 | ] 155 | }, 156 | { 157 | "cell_type": "markdown", 158 | "metadata": {}, 159 | "source": [ 160 | "## Getting the index from the Pandas Series" 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "execution_count": 422, 166 | "metadata": {}, 167 | "outputs": [ 168 | { 169 | "data": { 170 | "text/plain": [ 171 | "RangeIndex(start=0, stop=5, step=1)" 172 | ] 173 | }, 174 | "execution_count": 422, 175 | "metadata": {}, 176 | "output_type": "execute_result" 177 | } 178 | ], 179 | "source": [ 180 | "s.index" 181 | ] 182 | }, 183 | { 184 | "cell_type": "code", 185 | "execution_count": 423, 186 | "metadata": {}, 187 | "outputs": [ 188 | { 189 | "data": { 190 | "text/plain": [ 191 | "[0, 1, 2, 3, 4]" 192 | ] 193 | }, 194 | "execution_count": 423, 195 | "metadata": {}, 196 | "output_type": "execute_result" 197 | } 198 | ], 199 | "source": [ 200 | "list(s.index)" 201 | ] 202 | }, 203 | { 204 | "cell_type": "markdown", 205 | "metadata": {}, 206 | "source": [ 207 | "### Creating Pandas Series with custom index" 208 | ] 209 | }, 210 | { 211 | "cell_type": "code", 212 | "execution_count": 425, 213 | "metadata": {}, 214 | "outputs": [ 215 | { 216 | "name": "stdout", 217 | "output_type": "stream", 218 | "text": [ 219 | "1 1\n", 220 | "2 2\n", 221 | "3 3\n", 222 | "4 4\n", 223 | "5 5\n", 224 | "dtype: int64\n" 225 | ] 226 | } 227 | ], 228 | "source": [ 229 | "nums = [1, 2, 3, 4, 5]\n", 230 | "s = pd.Series(nums, index=[1, 2, 3, 4, 5])\n", 231 | "print(s)" 232 | ] 233 | }, 234 | { 235 | "cell_type": "code", 236 | "execution_count": 426, 237 | "metadata": {}, 238 | "outputs": [ 239 | { 240 | "data": { 241 | "text/plain": [ 242 | "Int64Index([1, 2, 3, 4, 5], dtype='int64')" 243 | ] 244 | }, 245 | "execution_count": 426, 246 | "metadata": {}, 247 | "output_type": "execute_result" 248 | } 249 | ], 250 | "source": [ 251 | "s.index" 252 | ] 253 | }, 254 | { 255 | "cell_type": "code", 256 | "execution_count": 428, 257 | "metadata": {}, 258 | "outputs": [ 259 | { 260 | "name": "stdout", 261 | "output_type": "stream", 262 | "text": [ 263 | "A 1\n", 264 | "B 2\n", 265 | "C 3\n", 266 | "D 4\n", 267 | "E 5\n", 268 | "dtype: int64\n" 269 | ] 270 | } 271 | ], 272 | "source": [ 273 | "nums = [1, 2, 3, 4, 5]\n", 274 | "s = pd.Series(nums, index=['A', 'B', 'C', 'D', 'E'])\n", 275 | "print(s)" 276 | ] 277 | }, 278 | { 279 | "cell_type": "code", 280 | "execution_count": 429, 281 | "metadata": {}, 282 | "outputs": [ 283 | { 284 | "data": { 285 | "text/plain": [ 286 | "Index(['A', 'B', 'C', 'D', 'E'], dtype='object')" 287 | ] 288 | }, 289 | "execution_count": 429, 290 | "metadata": {}, 291 | "output_type": "execute_result" 292 | } 293 | ], 294 | "source": [ 295 | "s.index" 296 | ] 297 | }, 298 | { 299 | "cell_type": "code", 300 | "execution_count": 430, 301 | "metadata": {}, 302 | "outputs": [ 303 | { 304 | "name": "stdout", 305 | "output_type": "stream", 306 | "text": [ 307 | "1 Orange\n", 308 | "2 Banana\n", 309 | "3 Mango\n", 310 | "dtype: object\n" 311 | ] 312 | } 313 | ], 314 | "source": [ 315 | "fruits = ['Orange','Banana','Mango']\n", 316 | "fruits = pd.Series(fruits, index=[1, 2, 3])\n", 317 | "print(fruits)" 318 | ] 319 | }, 320 | { 321 | "cell_type": "code", 322 | "execution_count": 431, 323 | "metadata": {}, 324 | "outputs": [ 325 | { 326 | "name": "stdout", 327 | "output_type": "stream", 328 | "text": [ 329 | "O Orange\n", 330 | "B Banana\n", 331 | "M Mango\n", 332 | "dtype: object\n" 333 | ] 334 | } 335 | ], 336 | "source": [ 337 | "fruits = ['Orange','Banana','Mango']\n", 338 | "fruits = pd.Series(fruits, index=['O', 'B', 'M'])\n", 339 | "print(fruits)" 340 | ] 341 | }, 342 | { 343 | "cell_type": "markdown", 344 | "metadata": {}, 345 | "source": [ 346 | "### Creating Pandas Series from a Dictionary" 347 | ] 348 | }, 349 | { 350 | "cell_type": "code", 351 | "execution_count": 432, 352 | "metadata": {}, 353 | "outputs": [ 354 | { 355 | "name": "stdout", 356 | "output_type": "stream", 357 | "text": [ 358 | "name Asabeneh\n", 359 | "country Finland\n", 360 | "city Helsinki\n", 361 | "dtype: object\n" 362 | ] 363 | } 364 | ], 365 | "source": [ 366 | "dct = {'name':'Asabeneh','country':'Finland','city':'Helsinki'}\n", 367 | "s = pd.Series(dct)\n", 368 | "print(s)" 369 | ] 370 | }, 371 | { 372 | "cell_type": "markdown", 373 | "metadata": {}, 374 | "source": [ 375 | "### Creating a Constant Pandas Series" 376 | ] 377 | }, 378 | { 379 | "cell_type": "code", 380 | "execution_count": 435, 381 | "metadata": {}, 382 | "outputs": [ 383 | { 384 | "name": "stdout", 385 | "output_type": "stream", 386 | "text": [ 387 | "1 10\n", 388 | "2 10\n", 389 | "3 10\n", 390 | "dtype: int64\n" 391 | ] 392 | } 393 | ], 394 | "source": [ 395 | "s = pd.Series(10, index = [1, 2, 3])\n", 396 | "print(s)" 397 | ] 398 | }, 399 | { 400 | "cell_type": "markdown", 401 | "metadata": {}, 402 | "source": [ 403 | "### Creating a Pandas Series Using Linspace" 404 | ] 405 | }, 406 | { 407 | "cell_type": "code", 408 | "execution_count": 436, 409 | "metadata": {}, 410 | "outputs": [ 411 | { 412 | "name": "stdout", 413 | "output_type": "stream", 414 | "text": [ 415 | "0 5.000000\n", 416 | "1 6.666667\n", 417 | "2 8.333333\n", 418 | "3 10.000000\n", 419 | "4 11.666667\n", 420 | "5 13.333333\n", 421 | "6 15.000000\n", 422 | "7 16.666667\n", 423 | "8 18.333333\n", 424 | "9 20.000000\n", 425 | "dtype: float64\n" 426 | ] 427 | } 428 | ], 429 | "source": [ 430 | "s = pd.Series(np.linspace(5, 20, 10)) # linspace(starting, end, items)\n", 431 | "print(s)" 432 | ] 433 | }, 434 | { 435 | "cell_type": "markdown", 436 | "metadata": {}, 437 | "source": [ 438 | "\n", 439 | "## DataFrames\n", 440 | "\n", 441 | "Pandas data frame has both rows and columns. It can be created in different ways. " 442 | ] 443 | }, 444 | { 445 | "cell_type": "markdown", 446 | "metadata": {}, 447 | "source": [ 448 | "### Creating DataFrames from List of Lists" 449 | ] 450 | }, 451 | { 452 | "cell_type": "code", 453 | "execution_count": 438, 454 | "metadata": {}, 455 | "outputs": [ 456 | { 457 | "data": { 458 | "text/html": [ 459 | "
\n", 460 | "\n", 473 | "\n", 474 | " \n", 475 | " \n", 476 | " \n", 477 | " \n", 478 | " \n", 479 | " \n", 480 | " \n", 481 | " \n", 482 | " \n", 483 | " \n", 484 | " \n", 485 | " \n", 486 | " \n", 487 | " \n", 488 | " \n", 489 | " \n", 490 | " \n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | "
NamesCountryCity
0AsabenehFinlandHelsink
1DavidUKLondon
2JohnSwedenStockholm
\n", 503 | "
" 504 | ], 505 | "text/plain": [ 506 | " Names Country City\n", 507 | "0 Asabeneh Finland Helsink\n", 508 | "1 David UK London\n", 509 | "2 John Sweden Stockholm" 510 | ] 511 | }, 512 | "execution_count": 438, 513 | "metadata": {}, 514 | "output_type": "execute_result" 515 | } 516 | ], 517 | "source": [ 518 | "data = [\n", 519 | " ['Asabeneh', 'Finland', 'Helsink'], \n", 520 | " ['David', 'UK', 'London'],\n", 521 | " ['John', 'Sweden', 'Stockholm']\n", 522 | "]\n", 523 | "df = pd.DataFrame(data, columns=['Names','Country','City'])\n", 524 | "df" 525 | ] 526 | }, 527 | { 528 | "cell_type": "markdown", 529 | "metadata": {}, 530 | "source": [ 531 | "### Creating DataFrame Using Dictionary" 532 | ] 533 | }, 534 | { 535 | "cell_type": "code", 536 | "execution_count": 439, 537 | "metadata": {}, 538 | "outputs": [ 539 | { 540 | "data": { 541 | "text/html": [ 542 | "
\n", 543 | "\n", 556 | "\n", 557 | " \n", 558 | " \n", 559 | " \n", 560 | " \n", 561 | " \n", 562 | " \n", 563 | " \n", 564 | " \n", 565 | " \n", 566 | " \n", 567 | " \n", 568 | " \n", 569 | " \n", 570 | " \n", 571 | " \n", 572 | " \n", 573 | " \n", 574 | " \n", 575 | " \n", 576 | " \n", 577 | " \n", 578 | " \n", 579 | " \n", 580 | " \n", 581 | " \n", 582 | " \n", 583 | " \n", 584 | " \n", 585 | "
NameCountryCity
0AsabenehFinlandHelsiki
1DavidUKLondon
2JohnSwedenStockholm
\n", 586 | "
" 587 | ], 588 | "text/plain": [ 589 | " Name Country City\n", 590 | "0 Asabeneh Finland Helsiki\n", 591 | "1 David UK London\n", 592 | "2 John Sweden Stockholm" 593 | ] 594 | }, 595 | "execution_count": 439, 596 | "metadata": {}, 597 | "output_type": "execute_result" 598 | } 599 | ], 600 | "source": [ 601 | "data = {'Name': ['Asabeneh', 'David', 'John'], 'Country':[\n", 602 | " 'Finland', 'UK', 'Sweden'], 'City': ['Helsiki', 'London', 'Stockholm']}\n", 603 | "df = pd.DataFrame(data)\n", 604 | "df" 605 | ] 606 | }, 607 | { 608 | "cell_type": "markdown", 609 | "metadata": {}, 610 | "source": [ 611 | "### Creating DataFrames from a List of Dictionaries" 612 | ] 613 | }, 614 | { 615 | "cell_type": "code", 616 | "execution_count": 440, 617 | "metadata": {}, 618 | "outputs": [ 619 | { 620 | "data": { 621 | "text/html": [ 622 | "
\n", 623 | "\n", 636 | "\n", 637 | " \n", 638 | " \n", 639 | " \n", 640 | " \n", 641 | " \n", 642 | " \n", 643 | " \n", 644 | " \n", 645 | " \n", 646 | " \n", 647 | " \n", 648 | " \n", 649 | " \n", 650 | " \n", 651 | " \n", 652 | " \n", 653 | " \n", 654 | " \n", 655 | " \n", 656 | " \n", 657 | " \n", 658 | " \n", 659 | " \n", 660 | " \n", 661 | " \n", 662 | " \n", 663 | " \n", 664 | " \n", 665 | "
NameCountryCity
0AsabenehFinlandHelsinki
1DavidUKLondon
2JohnSwedenStockholm
\n", 666 | "
" 667 | ], 668 | "text/plain": [ 669 | " Name Country City\n", 670 | "0 Asabeneh Finland Helsinki\n", 671 | "1 David UK London\n", 672 | "2 John Sweden Stockholm" 673 | ] 674 | }, 675 | "execution_count": 440, 676 | "metadata": {}, 677 | "output_type": "execute_result" 678 | } 679 | ], 680 | "source": [ 681 | "data = [\n", 682 | " {'Name': 'Asabeneh', 'Country': 'Finland', 'City': 'Helsinki'},\n", 683 | " {'Name': 'David', 'Country': 'UK', 'City': 'London'},\n", 684 | " {'Name': 'John', 'Country': 'Sweden', 'City': 'Stockholm'}]\n", 685 | "df = pd.DataFrame(data)\n", 686 | "df" 687 | ] 688 | }, 689 | { 690 | "cell_type": "markdown", 691 | "metadata": {}, 692 | "source": [ 693 | "## Reading different file formats Using Pandas" 694 | ] 695 | }, 696 | { 697 | "cell_type": "markdown", 698 | "metadata": {}, 699 | "source": [ 700 | "### Reading CSV File Using Pandas" 701 | ] 702 | }, 703 | { 704 | "cell_type": "markdown", 705 | "metadata": {}, 706 | "source": [ 707 | "#### Loading a CSV file" 708 | ] 709 | }, 710 | { 711 | "cell_type": "code", 712 | "execution_count": 441, 713 | "metadata": {}, 714 | "outputs": [ 715 | { 716 | "data": { 717 | "text/html": [ 718 | "
\n", 719 | "\n", 732 | "\n", 733 | " \n", 734 | " \n", 735 | " \n", 736 | " \n", 737 | " \n", 738 | " \n", 739 | " \n", 740 | " \n", 741 | " \n", 742 | " \n", 743 | " \n", 744 | " \n", 745 | " \n", 746 | " \n", 747 | " \n", 748 | " \n", 749 | " \n", 750 | " \n", 751 | " \n", 752 | " \n", 753 | " \n", 754 | " \n", 755 | " \n", 756 | " \n", 757 | " \n", 758 | " \n", 759 | " \n", 760 | " \n", 761 | " \n", 762 | " \n", 763 | " \n", 764 | " \n", 765 | " \n", 766 | " \n", 767 | " \n", 768 | " \n", 769 | " \n", 770 | " \n", 771 | " \n", 772 | " \n", 773 | " \n", 774 | " \n", 775 | " \n", 776 | " \n", 777 | " \n", 778 | " \n", 779 | " \n", 780 | " \n", 781 | " \n", 782 | " \n", 783 | " \n", 784 | " \n", 785 | " \n", 786 | " \n", 787 | " \n", 788 | " \n", 789 | " \n", 790 | " \n", 791 | " \n", 792 | " \n", 793 | " \n", 794 | " \n", 795 | " \n", 796 | " \n", 797 | " \n", 798 | " \n", 799 | " \n", 800 | " \n", 801 | " \n", 802 | " \n", 803 | " \n", 804 | " \n", 805 | " \n", 806 | " \n", 807 | " \n", 808 | " \n", 809 | "
GenderHeightWeight
0Male73.847017241.893563
1Male68.781904162.310473
2Male74.110105212.740856
3Male71.730978220.042470
4Male69.881796206.349801
............
9995Female66.172652136.777454
9996Female67.067155170.867906
9997Female63.867992128.475319
9998Female69.034243163.852461
9999Female61.944246113.649103
\n", 810 | "

10000 rows × 3 columns

\n", 811 | "
" 812 | ], 813 | "text/plain": [ 814 | " Gender Height Weight\n", 815 | "0 Male 73.847017 241.893563\n", 816 | "1 Male 68.781904 162.310473\n", 817 | "2 Male 74.110105 212.740856\n", 818 | "3 Male 71.730978 220.042470\n", 819 | "4 Male 69.881796 206.349801\n", 820 | "... ... ... ...\n", 821 | "9995 Female 66.172652 136.777454\n", 822 | "9996 Female 67.067155 170.867906\n", 823 | "9997 Female 63.867992 128.475319\n", 824 | "9998 Female 69.034243 163.852461\n", 825 | "9999 Female 61.944246 113.649103\n", 826 | "\n", 827 | "[10000 rows x 3 columns]" 828 | ] 829 | }, 830 | "execution_count": 441, 831 | "metadata": {}, 832 | "output_type": "execute_result" 833 | } 834 | ], 835 | "source": [ 836 | "import pandas as pd\n", 837 | "\n", 838 | "df = pd.read_csv('./datasets/weight-height.csv')\n", 839 | "df" 840 | ] 841 | }, 842 | { 843 | "cell_type": "markdown", 844 | "metadata": {}, 845 | "source": [ 846 | "#### Data Exploration\n", 847 | "\n", 848 | "Data exploration is an initial stage of data analysis used to explore and visualize data to get insights from the beginning of data analysis or identifing some patterns for further analysis." 849 | ] 850 | }, 851 | { 852 | "cell_type": "markdown", 853 | "metadata": {}, 854 | "source": [ 855 | "#### Reading the first few records of a dataset using head()\n", 856 | "The head() method gives 5 records by default, however, an agrument can be passed to the head() method. " 857 | ] 858 | }, 859 | { 860 | "cell_type": "code", 861 | "execution_count": 442, 862 | "metadata": {}, 863 | "outputs": [ 864 | { 865 | "data": { 866 | "text/html": [ 867 | "
\n", 868 | "\n", 881 | "\n", 882 | " \n", 883 | " \n", 884 | " \n", 885 | " \n", 886 | " \n", 887 | " \n", 888 | " \n", 889 | " \n", 890 | " \n", 891 | " \n", 892 | " \n", 893 | " \n", 894 | " \n", 895 | " \n", 896 | " \n", 897 | " \n", 898 | " \n", 899 | " \n", 900 | " \n", 901 | " \n", 902 | " \n", 903 | " \n", 904 | " \n", 905 | " \n", 906 | " \n", 907 | " \n", 908 | " \n", 909 | " \n", 910 | " \n", 911 | " \n", 912 | " \n", 913 | " \n", 914 | " \n", 915 | " \n", 916 | " \n", 917 | " \n", 918 | " \n", 919 | " \n", 920 | " \n", 921 | " \n", 922 | "
GenderHeightWeight
0Male73.847017241.893563
1Male68.781904162.310473
2Male74.110105212.740856
3Male71.730978220.042470
4Male69.881796206.349801
\n", 923 | "
" 924 | ], 925 | "text/plain": [ 926 | " Gender Height Weight\n", 927 | "0 Male 73.847017 241.893563\n", 928 | "1 Male 68.781904 162.310473\n", 929 | "2 Male 74.110105 212.740856\n", 930 | "3 Male 71.730978 220.042470\n", 931 | "4 Male 69.881796 206.349801" 932 | ] 933 | }, 934 | "execution_count": 442, 935 | "metadata": {}, 936 | "output_type": "execute_result" 937 | } 938 | ], 939 | "source": [ 940 | "df.head()" 941 | ] 942 | }, 943 | { 944 | "cell_type": "markdown", 945 | "metadata": {}, 946 | "source": [ 947 | "The head() method with argument provides as large as the size of the argument. If we pass 10 in the head() as argument will get 10 records." 948 | ] 949 | }, 950 | { 951 | "cell_type": "code", 952 | "execution_count": 443, 953 | "metadata": {}, 954 | "outputs": [ 955 | { 956 | "data": { 957 | "text/html": [ 958 | "
\n", 959 | "\n", 972 | "\n", 973 | " \n", 974 | " \n", 975 | " \n", 976 | " \n", 977 | " \n", 978 | " \n", 979 | " \n", 980 | " \n", 981 | " \n", 982 | " \n", 983 | " \n", 984 | " \n", 985 | " \n", 986 | " \n", 987 | " \n", 988 | " \n", 989 | " \n", 990 | " \n", 991 | " \n", 992 | " \n", 993 | " \n", 994 | " \n", 995 | " \n", 996 | " \n", 997 | " \n", 998 | " \n", 999 | " \n", 1000 | " \n", 1001 | " \n", 1002 | " \n", 1003 | " \n", 1004 | " \n", 1005 | " \n", 1006 | " \n", 1007 | " \n", 1008 | " \n", 1009 | " \n", 1010 | " \n", 1011 | " \n", 1012 | " \n", 1013 | " \n", 1014 | " \n", 1015 | " \n", 1016 | " \n", 1017 | " \n", 1018 | " \n", 1019 | " \n", 1020 | " \n", 1021 | " \n", 1022 | " \n", 1023 | " \n", 1024 | " \n", 1025 | " \n", 1026 | " \n", 1027 | " \n", 1028 | " \n", 1029 | " \n", 1030 | " \n", 1031 | " \n", 1032 | " \n", 1033 | " \n", 1034 | " \n", 1035 | " \n", 1036 | " \n", 1037 | " \n", 1038 | " \n", 1039 | " \n", 1040 | " \n", 1041 | " \n", 1042 | " \n", 1043 | "
GenderHeightWeight
0Male73.847017241.893563
1Male68.781904162.310473
2Male74.110105212.740856
3Male71.730978220.042470
4Male69.881796206.349801
5Male67.253016152.212156
6Male68.785081183.927889
7Male68.348516167.971110
8Male67.018950175.929440
9Male63.456494156.399676
\n", 1044 | "
" 1045 | ], 1046 | "text/plain": [ 1047 | " Gender Height Weight\n", 1048 | "0 Male 73.847017 241.893563\n", 1049 | "1 Male 68.781904 162.310473\n", 1050 | "2 Male 74.110105 212.740856\n", 1051 | "3 Male 71.730978 220.042470\n", 1052 | "4 Male 69.881796 206.349801\n", 1053 | "5 Male 67.253016 152.212156\n", 1054 | "6 Male 68.785081 183.927889\n", 1055 | "7 Male 68.348516 167.971110\n", 1056 | "8 Male 67.018950 175.929440\n", 1057 | "9 Male 63.456494 156.399676" 1058 | ] 1059 | }, 1060 | "execution_count": 443, 1061 | "metadata": {}, 1062 | "output_type": "execute_result" 1063 | } 1064 | ], 1065 | "source": [ 1066 | "df.head(10)" 1067 | ] 1068 | }, 1069 | { 1070 | "cell_type": "markdown", 1071 | "metadata": {}, 1072 | "source": [ 1073 | "### Reading the last records of a dataset\n", 1074 | "\n", 1075 | "To explore the last five records of the data set we use the tail() method. However, we can get fewer or larger records by changing the argument we pass to the tail() method.\n", 1076 | "\n", 1077 | "\n" 1078 | ] 1079 | }, 1080 | { 1081 | "cell_type": "code", 1082 | "execution_count": 444, 1083 | "metadata": {}, 1084 | "outputs": [ 1085 | { 1086 | "data": { 1087 | "text/html": [ 1088 | "
\n", 1089 | "\n", 1102 | "\n", 1103 | " \n", 1104 | " \n", 1105 | " \n", 1106 | " \n", 1107 | " \n", 1108 | " \n", 1109 | " \n", 1110 | " \n", 1111 | " \n", 1112 | " \n", 1113 | " \n", 1114 | " \n", 1115 | " \n", 1116 | " \n", 1117 | " \n", 1118 | " \n", 1119 | " \n", 1120 | " \n", 1121 | " \n", 1122 | " \n", 1123 | " \n", 1124 | " \n", 1125 | " \n", 1126 | " \n", 1127 | " \n", 1128 | " \n", 1129 | " \n", 1130 | " \n", 1131 | " \n", 1132 | " \n", 1133 | " \n", 1134 | " \n", 1135 | " \n", 1136 | " \n", 1137 | " \n", 1138 | " \n", 1139 | " \n", 1140 | " \n", 1141 | " \n", 1142 | " \n", 1143 | "
GenderHeightWeight
9995Female66.172652136.777454
9996Female67.067155170.867906
9997Female63.867992128.475319
9998Female69.034243163.852461
9999Female61.944246113.649103
\n", 1144 | "
" 1145 | ], 1146 | "text/plain": [ 1147 | " Gender Height Weight\n", 1148 | "9995 Female 66.172652 136.777454\n", 1149 | "9996 Female 67.067155 170.867906\n", 1150 | "9997 Female 63.867992 128.475319\n", 1151 | "9998 Female 69.034243 163.852461\n", 1152 | "9999 Female 61.944246 113.649103" 1153 | ] 1154 | }, 1155 | "execution_count": 444, 1156 | "metadata": {}, 1157 | "output_type": "execute_result" 1158 | } 1159 | ], 1160 | "source": [ 1161 | "df.tail()" 1162 | ] 1163 | }, 1164 | { 1165 | "cell_type": "code", 1166 | "execution_count": 445, 1167 | "metadata": {}, 1168 | "outputs": [ 1169 | { 1170 | "data": { 1171 | "text/html": [ 1172 | "
\n", 1173 | "\n", 1186 | "\n", 1187 | " \n", 1188 | " \n", 1189 | " \n", 1190 | " \n", 1191 | " \n", 1192 | " \n", 1193 | " \n", 1194 | " \n", 1195 | " \n", 1196 | " \n", 1197 | " \n", 1198 | " \n", 1199 | " \n", 1200 | " \n", 1201 | " \n", 1202 | " \n", 1203 | " \n", 1204 | " \n", 1205 | " \n", 1206 | " \n", 1207 | " \n", 1208 | " \n", 1209 | " \n", 1210 | " \n", 1211 | " \n", 1212 | " \n", 1213 | " \n", 1214 | " \n", 1215 | " \n", 1216 | " \n", 1217 | " \n", 1218 | " \n", 1219 | " \n", 1220 | " \n", 1221 | " \n", 1222 | " \n", 1223 | " \n", 1224 | " \n", 1225 | " \n", 1226 | " \n", 1227 | " \n", 1228 | " \n", 1229 | " \n", 1230 | " \n", 1231 | " \n", 1232 | " \n", 1233 | " \n", 1234 | " \n", 1235 | " \n", 1236 | " \n", 1237 | " \n", 1238 | " \n", 1239 | " \n", 1240 | " \n", 1241 | " \n", 1242 | " \n", 1243 | " \n", 1244 | " \n", 1245 | " \n", 1246 | " \n", 1247 | " \n", 1248 | " \n", 1249 | " \n", 1250 | " \n", 1251 | " \n", 1252 | " \n", 1253 | " \n", 1254 | " \n", 1255 | " \n", 1256 | " \n", 1257 | "
GenderHeightWeight
9990Female63.179498141.266100
9991Female62.636675102.853563
9992Female62.077832138.691680
9993Female60.03043497.687432
9994Female59.098250110.529686
9995Female66.172652136.777454
9996Female67.067155170.867906
9997Female63.867992128.475319
9998Female69.034243163.852461
9999Female61.944246113.649103
\n", 1258 | "
" 1259 | ], 1260 | "text/plain": [ 1261 | " Gender Height Weight\n", 1262 | "9990 Female 63.179498 141.266100\n", 1263 | "9991 Female 62.636675 102.853563\n", 1264 | "9992 Female 62.077832 138.691680\n", 1265 | "9993 Female 60.030434 97.687432\n", 1266 | "9994 Female 59.098250 110.529686\n", 1267 | "9995 Female 66.172652 136.777454\n", 1268 | "9996 Female 67.067155 170.867906\n", 1269 | "9997 Female 63.867992 128.475319\n", 1270 | "9998 Female 69.034243 163.852461\n", 1271 | "9999 Female 61.944246 113.649103" 1272 | ] 1273 | }, 1274 | "execution_count": 445, 1275 | "metadata": {}, 1276 | "output_type": "execute_result" 1277 | } 1278 | ], 1279 | "source": [ 1280 | "df.tail(10) # tail() method with an argument" 1281 | ] 1282 | }, 1283 | { 1284 | "cell_type": "markdown", 1285 | "metadata": {}, 1286 | "source": [ 1287 | "### Number of Columns\n", 1288 | "\n", 1289 | "Knowing the fields or attributes of the dataset is one part of data exploration. In this dataset there are only three columns but most of the time, the size of columns is larger than this. Therefore, it is good to know how to get the columns and the size of the columns.\n", 1290 | "We will use the .columns DataFrame attribute to get a column list." 1291 | ] 1292 | }, 1293 | { 1294 | "cell_type": "code", 1295 | "execution_count": 446, 1296 | "metadata": {}, 1297 | "outputs": [ 1298 | { 1299 | "data": { 1300 | "text/plain": [ 1301 | "Index(['Gender', 'Height', 'Weight'], dtype='object')" 1302 | ] 1303 | }, 1304 | "execution_count": 446, 1305 | "metadata": {}, 1306 | "output_type": "execute_result" 1307 | } 1308 | ], 1309 | "source": [ 1310 | "df.columns" 1311 | ] 1312 | }, 1313 | { 1314 | "cell_type": "markdown", 1315 | "metadata": {}, 1316 | "source": [ 1317 | "### DataFrame shape\n", 1318 | "\n", 1319 | "The DataFrame shape allows to understand the dataset better. It tells the number of rows and columns" 1320 | ] 1321 | }, 1322 | { 1323 | "cell_type": "code", 1324 | "execution_count": 447, 1325 | "metadata": {}, 1326 | "outputs": [ 1327 | { 1328 | "data": { 1329 | "text/plain": [ 1330 | "(10000, 3)" 1331 | ] 1332 | }, 1333 | "execution_count": 447, 1334 | "metadata": {}, 1335 | "output_type": "execute_result" 1336 | } 1337 | ], 1338 | "source": [ 1339 | "df.shape" 1340 | ] 1341 | }, 1342 | { 1343 | "cell_type": "markdown", 1344 | "metadata": {}, 1345 | "source": [ 1346 | "#### Descriptive Statistics\n", 1347 | "\n", 1348 | "Descriptive statistics summarizes a given data set that can be either a representation of the entire or a sample of a population. Descriptive statistics are divided into measures of central tendency and measures of variability (spread).\n", 1349 | "\n", 1350 | "Measures of central tendency includes:\n", 1351 | "\n", 1352 | "- mean\n", 1353 | "- median\n", 1354 | "- mode\n", 1355 | "\n", 1356 | "Measures of variability include:\n", 1357 | "\n", 1358 | "- standard deviation\n", 1359 | "- variance\n", 1360 | "- minimum\n", 1361 | "- maximum\n", 1362 | "- kurtosis\n", 1363 | "- skewness\n", 1364 | "\n", 1365 | "Pandas describe() provides a descriptive statistics of a dataset. The method takes a couple of arguments\n", 1366 | "```py\n", 1367 | "DataFrame.describe(percentiles=None, include=None, exclude=None, datetime_is_numeric=False)\n", 1368 | "```\n", 1369 | "\n" 1370 | ] 1371 | }, 1372 | { 1373 | "cell_type": "code", 1374 | "execution_count": 448, 1375 | "metadata": {}, 1376 | "outputs": [ 1377 | { 1378 | "data": { 1379 | "text/html": [ 1380 | "
\n", 1381 | "\n", 1394 | "\n", 1395 | " \n", 1396 | " \n", 1397 | " \n", 1398 | " \n", 1399 | " \n", 1400 | " \n", 1401 | " \n", 1402 | " \n", 1403 | " \n", 1404 | " \n", 1405 | " \n", 1406 | " \n", 1407 | " \n", 1408 | " \n", 1409 | " \n", 1410 | " \n", 1411 | " \n", 1412 | " \n", 1413 | " \n", 1414 | " \n", 1415 | " \n", 1416 | " \n", 1417 | " \n", 1418 | " \n", 1419 | " \n", 1420 | " \n", 1421 | " \n", 1422 | " \n", 1423 | " \n", 1424 | " \n", 1425 | " \n", 1426 | " \n", 1427 | " \n", 1428 | " \n", 1429 | " \n", 1430 | " \n", 1431 | " \n", 1432 | " \n", 1433 | " \n", 1434 | " \n", 1435 | " \n", 1436 | " \n", 1437 | " \n", 1438 | " \n", 1439 | " \n", 1440 | " \n", 1441 | " \n", 1442 | " \n", 1443 | " \n", 1444 | "
HeightWeight
count10000.00000010000.000000
mean66.367560161.440357
std3.84752832.108439
min54.26313364.700127
25%63.505620135.818051
50%66.318070161.212928
75%69.174262187.169525
max78.998742269.989699
\n", 1445 | "
" 1446 | ], 1447 | "text/plain": [ 1448 | " Height Weight\n", 1449 | "count 10000.000000 10000.000000\n", 1450 | "mean 66.367560 161.440357\n", 1451 | "std 3.847528 32.108439\n", 1452 | "min 54.263133 64.700127\n", 1453 | "25% 63.505620 135.818051\n", 1454 | "50% 66.318070 161.212928\n", 1455 | "75% 69.174262 187.169525\n", 1456 | "max 78.998742 269.989699" 1457 | ] 1458 | }, 1459 | "execution_count": 448, 1460 | "metadata": {}, 1461 | "output_type": "execute_result" 1462 | } 1463 | ], 1464 | "source": [ 1465 | "df.describe() # without any argument" 1466 | ] 1467 | }, 1468 | { 1469 | "cell_type": "code", 1470 | "execution_count": 449, 1471 | "metadata": {}, 1472 | "outputs": [ 1473 | { 1474 | "data": { 1475 | "text/html": [ 1476 | "
\n", 1477 | "\n", 1490 | "\n", 1491 | " \n", 1492 | " \n", 1493 | " \n", 1494 | " \n", 1495 | " \n", 1496 | " \n", 1497 | " \n", 1498 | " \n", 1499 | " \n", 1500 | " \n", 1501 | " \n", 1502 | " \n", 1503 | " \n", 1504 | " \n", 1505 | " \n", 1506 | " \n", 1507 | " \n", 1508 | " \n", 1509 | " \n", 1510 | " \n", 1511 | " \n", 1512 | " \n", 1513 | " \n", 1514 | " \n", 1515 | " \n", 1516 | " \n", 1517 | " \n", 1518 | " \n", 1519 | " \n", 1520 | " \n", 1521 | " \n", 1522 | " \n", 1523 | " \n", 1524 | " \n", 1525 | " \n", 1526 | " \n", 1527 | " \n", 1528 | " \n", 1529 | " \n", 1530 | " \n", 1531 | " \n", 1532 | " \n", 1533 | " \n", 1534 | " \n", 1535 | " \n", 1536 | " \n", 1537 | " \n", 1538 | " \n", 1539 | " \n", 1540 | " \n", 1541 | " \n", 1542 | " \n", 1543 | " \n", 1544 | " \n", 1545 | " \n", 1546 | " \n", 1547 | " \n", 1548 | " \n", 1549 | " \n", 1550 | " \n", 1551 | " \n", 1552 | " \n", 1553 | " \n", 1554 | " \n", 1555 | " \n", 1556 | " \n", 1557 | " \n", 1558 | " \n", 1559 | " \n", 1560 | " \n", 1561 | " \n", 1562 | " \n", 1563 | " \n", 1564 | " \n", 1565 | " \n", 1566 | " \n", 1567 | " \n", 1568 | " \n", 1569 | " \n", 1570 | " \n", 1571 | " \n", 1572 | " \n", 1573 | "
GenderHeightWeight
count1000010000.00000010000.000000
unique2NaNNaN
topMaleNaNNaN
freq5000NaNNaN
meanNaN66.367560161.440357
stdNaN3.84752832.108439
minNaN54.26313364.700127
25%NaN63.505620135.818051
50%NaN66.318070161.212928
75%NaN69.174262187.169525
85%NaN70.577106197.536443
maxNaN78.998742269.989699
\n", 1574 | "
" 1575 | ], 1576 | "text/plain": [ 1577 | " Gender Height Weight\n", 1578 | "count 10000 10000.000000 10000.000000\n", 1579 | "unique 2 NaN NaN\n", 1580 | "top Male NaN NaN\n", 1581 | "freq 5000 NaN NaN\n", 1582 | "mean NaN 66.367560 161.440357\n", 1583 | "std NaN 3.847528 32.108439\n", 1584 | "min NaN 54.263133 64.700127\n", 1585 | "25% NaN 63.505620 135.818051\n", 1586 | "50% NaN 66.318070 161.212928\n", 1587 | "75% NaN 69.174262 187.169525\n", 1588 | "85% NaN 70.577106 197.536443\n", 1589 | "max NaN 78.998742 269.989699" 1590 | ] 1591 | }, 1592 | "execution_count": 449, 1593 | "metadata": {}, 1594 | "output_type": "execute_result" 1595 | } 1596 | ], 1597 | "source": [ 1598 | "df.describe(include='all', percentiles=[0.25, 0.5, 0.75, 0.85])" 1599 | ] 1600 | }, 1601 | { 1602 | "cell_type": "markdown", 1603 | "metadata": {}, 1604 | "source": [ 1605 | "### Get information about the dataset\n", 1606 | "\n", 1607 | "It also possible to get some information about the dataset using the method info(). The info() takes a couple of arguments.\n", 1608 | "\n", 1609 | "```py\n", 1610 | "DataFrame.info(verbose=None, buf=None, max_cols=None, memory_usage=None, show_counts=None, null_counts=None\n", 1611 | "```" 1612 | ] 1613 | }, 1614 | { 1615 | "cell_type": "code", 1616 | "execution_count": 450, 1617 | "metadata": {}, 1618 | "outputs": [ 1619 | { 1620 | "name": "stdout", 1621 | "output_type": "stream", 1622 | "text": [ 1623 | "\n", 1624 | "RangeIndex: 10000 entries, 0 to 9999\n", 1625 | "Data columns (total 3 columns):\n", 1626 | " # Column Non-Null Count Dtype \n", 1627 | "--- ------ -------------- ----- \n", 1628 | " 0 Gender 10000 non-null object \n", 1629 | " 1 Height 10000 non-null float64\n", 1630 | " 2 Weight 10000 non-null float64\n", 1631 | "dtypes: float64(2), object(1)\n", 1632 | "memory usage: 234.5+ KB\n" 1633 | ] 1634 | } 1635 | ], 1636 | "source": [ 1637 | "df.info()" 1638 | ] 1639 | }, 1640 | { 1641 | "cell_type": "code", 1642 | "execution_count": 451, 1643 | "metadata": {}, 1644 | "outputs": [ 1645 | { 1646 | "name": "stdout", 1647 | "output_type": "stream", 1648 | "text": [ 1649 | "\n", 1650 | "RangeIndex: 10000 entries, 0 to 9999\n", 1651 | "Data columns (total 3 columns):\n", 1652 | " # Column Non-Null Count Dtype \n", 1653 | "--- ------ -------------- ----- \n", 1654 | " 0 Gender 10000 non-null object \n", 1655 | " 1 Height 10000 non-null float64\n", 1656 | " 2 Weight 10000 non-null float64\n", 1657 | "dtypes: float64(2), object(1)\n", 1658 | "memory usage: 234.5+ KB\n" 1659 | ] 1660 | } 1661 | ], 1662 | "source": [ 1663 | "df.info(verbose=True)" 1664 | ] 1665 | }, 1666 | { 1667 | "cell_type": "markdown", 1668 | "metadata": {}, 1669 | "source": [ 1670 | "## Modifying a DataFrame\n", 1671 | "\n", 1672 | "Modifying a DataFrame:\n", 1673 | "\n", 1674 | " - We can create a new DataFrame\n", 1675 | " - We can create a new column and add it to the DataFrame, \n", 1676 | " - we can remove an existing column from a DataFrame, \n", 1677 | " - we can modify an existing column in a DataFrame, \n", 1678 | " - we can change the data type of column values in the DataFrame" 1679 | ] 1680 | }, 1681 | { 1682 | "cell_type": "markdown", 1683 | "metadata": {}, 1684 | "source": [ 1685 | "### Creating a DataFrame\n", 1686 | "\n", 1687 | "As we have seen before, it is possible to create DataFrame from list of lists, list of dictionaries or dictionaries.\n", 1688 | "\n", 1689 | "As always, first we import the necessary packages. Now, lets import pandas and numpy, two best friends ever." 1690 | ] 1691 | }, 1692 | { 1693 | "cell_type": "code", 1694 | "execution_count": 452, 1695 | "metadata": {}, 1696 | "outputs": [ 1697 | { 1698 | "name": "stdout", 1699 | "output_type": "stream", 1700 | "text": [ 1701 | " Name Country City\n", 1702 | "0 Asabeneh Finland Helsinki\n", 1703 | "1 David UK London\n", 1704 | "2 John Sweden Stockholm\n", 1705 | "3 Eyob Finland Espoo\n", 1706 | "4 Pawel Poland Warsaw\n", 1707 | "5 Lidiya NaN NaN\n" 1708 | ] 1709 | } 1710 | ], 1711 | "source": [ 1712 | "\n", 1713 | "import pandas as pd\n", 1714 | "import numpy as np\n", 1715 | "data = [\n", 1716 | " {\"Name\": \"Asabeneh\", \"Country\":\"Finland\",\"City\":\"Helsinki\"},\n", 1717 | " {\"Name\": \"David\", \"Country\":\"UK\",\"City\":\"London\"},\n", 1718 | " {\"Name\": \"John\", \"Country\":\"Sweden\",\"City\":\"Stockholm\"},\n", 1719 | " {\"Name\": \"Eyob\", \"Country\":\"Finland\",\"City\":\"Espoo\"},\n", 1720 | " {\"Name\": \"Pawel\", \"Country\":\"Poland\",\"City\":\"Warsaw\"},\n", 1721 | " {\"Name\": \"Lidiya\", \"Country\":float('NaN'),\"City\":float('NaN')},\n", 1722 | "]\n", 1723 | "df = pd.DataFrame(data)\n", 1724 | "print(df)" 1725 | ] 1726 | }, 1727 | { 1728 | "cell_type": "markdown", 1729 | "metadata": {}, 1730 | "source": [ 1731 | "### Adding a New Column\n", 1732 | "Let's add a weight column in the DataFrame" 1733 | ] 1734 | }, 1735 | { 1736 | "cell_type": "code", 1737 | "execution_count": 453, 1738 | "metadata": {}, 1739 | "outputs": [ 1740 | { 1741 | "data": { 1742 | "text/html": [ 1743 | "
\n", 1744 | "\n", 1757 | "\n", 1758 | " \n", 1759 | " \n", 1760 | " \n", 1761 | " \n", 1762 | " \n", 1763 | " \n", 1764 | " \n", 1765 | " \n", 1766 | " \n", 1767 | " \n", 1768 | " \n", 1769 | " \n", 1770 | " \n", 1771 | " \n", 1772 | " \n", 1773 | " \n", 1774 | " \n", 1775 | " \n", 1776 | " \n", 1777 | " \n", 1778 | " \n", 1779 | " \n", 1780 | " \n", 1781 | " \n", 1782 | " \n", 1783 | " \n", 1784 | " \n", 1785 | " \n", 1786 | " \n", 1787 | " \n", 1788 | " \n", 1789 | " \n", 1790 | " \n", 1791 | " \n", 1792 | " \n", 1793 | " \n", 1794 | " \n", 1795 | " \n", 1796 | " \n", 1797 | " \n", 1798 | " \n", 1799 | " \n", 1800 | " \n", 1801 | " \n", 1802 | " \n", 1803 | " \n", 1804 | " \n", 1805 | " \n", 1806 | " \n", 1807 | " \n", 1808 | " \n", 1809 | " \n", 1810 | " \n", 1811 | "
NameCountryCityWeight
0AsabenehFinlandHelsinki74.0
1DavidUKLondon78.0
2JohnSwedenStockholm69.0
3EyobFinlandEspoo71.0
4PawelPolandWarsaw102.0
5LidiyaNaNNaNNaN
\n", 1812 | "
" 1813 | ], 1814 | "text/plain": [ 1815 | " Name Country City Weight\n", 1816 | "0 Asabeneh Finland Helsinki 74.0\n", 1817 | "1 David UK London 78.0\n", 1818 | "2 John Sweden Stockholm 69.0\n", 1819 | "3 Eyob Finland Espoo 71.0\n", 1820 | "4 Pawel Poland Warsaw 102.0\n", 1821 | "5 Lidiya NaN NaN NaN" 1822 | ] 1823 | }, 1824 | "execution_count": 453, 1825 | "metadata": {}, 1826 | "output_type": "execute_result" 1827 | } 1828 | ], 1829 | "source": [ 1830 | "weights = [74, 78, 69, 71, 102, float('NaN')]\n", 1831 | "df['Weight'] = weights\n", 1832 | "df" 1833 | ] 1834 | }, 1835 | { 1836 | "cell_type": "markdown", 1837 | "metadata": {}, 1838 | "source": [ 1839 | "Let's add a height column into the DataFrame as well" 1840 | ] 1841 | }, 1842 | { 1843 | "cell_type": "code", 1844 | "execution_count": 454, 1845 | "metadata": {}, 1846 | "outputs": [ 1847 | { 1848 | "name": "stdout", 1849 | "output_type": "stream", 1850 | "text": [ 1851 | " Name Country City Weight Height\n", 1852 | "0 Asabeneh Finland Helsinki 74.0 173.0\n", 1853 | "1 David UK London 78.0 175.0\n", 1854 | "2 John Sweden Stockholm 69.0 169.0\n", 1855 | "3 Eyob Finland Espoo 71.0 173.0\n", 1856 | "4 Pawel Poland Warsaw 102.0 195.0\n", 1857 | "5 Lidiya NaN NaN NaN NaN\n" 1858 | ] 1859 | } 1860 | ], 1861 | "source": [ 1862 | "heights = [173, 175, 169, 173, 195, float('NaN')]\n", 1863 | "df['Height'] = heights\n", 1864 | "print(df)" 1865 | ] 1866 | }, 1867 | { 1868 | "cell_type": "markdown", 1869 | "metadata": {}, 1870 | "source": [ 1871 | "As you can see in the DataFrame above, we did add new columns, Weight and Height. Let's add one additional column called BMI(Body Mass Index) by calculating their BMI using thier mass and height. BMI is mass divided by height squared (in meters) - Weight/Height * Height.\n", 1872 | "\n", 1873 | "As you can see, the height is in centimeters, so we shoud change it to meters. Let's modify the height row." 1874 | ] 1875 | }, 1876 | { 1877 | "cell_type": "markdown", 1878 | "metadata": {}, 1879 | "source": [ 1880 | "### Modifying column values" 1881 | ] 1882 | }, 1883 | { 1884 | "cell_type": "code", 1885 | "execution_count": 455, 1886 | "metadata": {}, 1887 | "outputs": [ 1888 | { 1889 | "data": { 1890 | "text/html": [ 1891 | "
\n", 1892 | "\n", 1905 | "\n", 1906 | " \n", 1907 | " \n", 1908 | " \n", 1909 | " \n", 1910 | " \n", 1911 | " \n", 1912 | " \n", 1913 | " \n", 1914 | " \n", 1915 | " \n", 1916 | " \n", 1917 | " \n", 1918 | " \n", 1919 | " \n", 1920 | " \n", 1921 | " \n", 1922 | " \n", 1923 | " \n", 1924 | " \n", 1925 | " \n", 1926 | " \n", 1927 | " \n", 1928 | " \n", 1929 | " \n", 1930 | " \n", 1931 | " \n", 1932 | " \n", 1933 | " \n", 1934 | " \n", 1935 | " \n", 1936 | " \n", 1937 | " \n", 1938 | " \n", 1939 | " \n", 1940 | " \n", 1941 | " \n", 1942 | " \n", 1943 | " \n", 1944 | " \n", 1945 | " \n", 1946 | " \n", 1947 | " \n", 1948 | " \n", 1949 | " \n", 1950 | " \n", 1951 | " \n", 1952 | " \n", 1953 | " \n", 1954 | " \n", 1955 | " \n", 1956 | " \n", 1957 | " \n", 1958 | " \n", 1959 | " \n", 1960 | " \n", 1961 | " \n", 1962 | " \n", 1963 | " \n", 1964 | " \n", 1965 | " \n", 1966 | "
NameCountryCityWeightHeight
0AsabenehFinlandHelsinki74.01.73
1DavidUKLondon78.01.75
2JohnSwedenStockholm69.01.69
3EyobFinlandEspoo71.01.73
4PawelPolandWarsaw102.01.95
5LidiyaNaNNaNNaNNaN
\n", 1967 | "
" 1968 | ], 1969 | "text/plain": [ 1970 | " Name Country City Weight Height\n", 1971 | "0 Asabeneh Finland Helsinki 74.0 1.73\n", 1972 | "1 David UK London 78.0 1.75\n", 1973 | "2 John Sweden Stockholm 69.0 1.69\n", 1974 | "3 Eyob Finland Espoo 71.0 1.73\n", 1975 | "4 Pawel Poland Warsaw 102.0 1.95\n", 1976 | "5 Lidiya NaN NaN NaN NaN" 1977 | ] 1978 | }, 1979 | "execution_count": 455, 1980 | "metadata": {}, 1981 | "output_type": "execute_result" 1982 | } 1983 | ], 1984 | "source": [ 1985 | "df['Height'] = df['Height'] * 0.01\n", 1986 | "df" 1987 | ] 1988 | }, 1989 | { 1990 | "cell_type": "code", 1991 | "execution_count": 456, 1992 | "metadata": {}, 1993 | "outputs": [], 1994 | "source": [ 1995 | "# Using functions makes our code clean, but you can calculate the bmi without a function\n", 1996 | "def calculate_bmi ():\n", 1997 | " weights = df['Weight']\n", 1998 | " heights = df['Height']\n", 1999 | " bmi = []\n", 2000 | " for w,h in zip(weights, heights):\n", 2001 | " b = w/(h*h)\n", 2002 | " bmi.append(b)\n", 2003 | " return bmi\n", 2004 | " \n", 2005 | "bmi = calculate_bmi()" 2006 | ] 2007 | }, 2008 | { 2009 | "cell_type": "code", 2010 | "execution_count": 457, 2011 | "metadata": {}, 2012 | "outputs": [ 2013 | { 2014 | "data": { 2015 | "text/html": [ 2016 | "
\n", 2017 | "\n", 2030 | "\n", 2031 | " \n", 2032 | " \n", 2033 | " \n", 2034 | " \n", 2035 | " \n", 2036 | " \n", 2037 | " \n", 2038 | " \n", 2039 | " \n", 2040 | " \n", 2041 | " \n", 2042 | " \n", 2043 | " \n", 2044 | " \n", 2045 | " \n", 2046 | " \n", 2047 | " \n", 2048 | " \n", 2049 | " \n", 2050 | " \n", 2051 | " \n", 2052 | " \n", 2053 | " \n", 2054 | " \n", 2055 | " \n", 2056 | " \n", 2057 | " \n", 2058 | " \n", 2059 | " \n", 2060 | " \n", 2061 | " \n", 2062 | " \n", 2063 | " \n", 2064 | " \n", 2065 | " \n", 2066 | " \n", 2067 | " \n", 2068 | " \n", 2069 | " \n", 2070 | " \n", 2071 | " \n", 2072 | " \n", 2073 | " \n", 2074 | " \n", 2075 | " \n", 2076 | " \n", 2077 | " \n", 2078 | " \n", 2079 | " \n", 2080 | " \n", 2081 | " \n", 2082 | " \n", 2083 | " \n", 2084 | " \n", 2085 | " \n", 2086 | " \n", 2087 | " \n", 2088 | " \n", 2089 | " \n", 2090 | " \n", 2091 | " \n", 2092 | " \n", 2093 | " \n", 2094 | " \n", 2095 | " \n", 2096 | " \n", 2097 | " \n", 2098 | "
NameCountryCityWeightHeightBMI
0AsabenehFinlandHelsinki74.01.7324.725183
1DavidUKLondon78.01.7525.469388
2JohnSwedenStockholm69.01.6924.158818
3EyobFinlandEspoo71.01.7323.722811
4PawelPolandWarsaw102.01.9526.824458
5LidiyaNaNNaNNaNNaNNaN
\n", 2099 | "
" 2100 | ], 2101 | "text/plain": [ 2102 | " Name Country City Weight Height BMI\n", 2103 | "0 Asabeneh Finland Helsinki 74.0 1.73 24.725183\n", 2104 | "1 David UK London 78.0 1.75 25.469388\n", 2105 | "2 John Sweden Stockholm 69.0 1.69 24.158818\n", 2106 | "3 Eyob Finland Espoo 71.0 1.73 23.722811\n", 2107 | "4 Pawel Poland Warsaw 102.0 1.95 26.824458\n", 2108 | "5 Lidiya NaN NaN NaN NaN NaN" 2109 | ] 2110 | }, 2111 | "execution_count": 457, 2112 | "metadata": {}, 2113 | "output_type": "execute_result" 2114 | } 2115 | ], 2116 | "source": [ 2117 | "df['BMI'] = bmi\n", 2118 | "df" 2119 | ] 2120 | }, 2121 | { 2122 | "cell_type": "markdown", 2123 | "metadata": {}, 2124 | "source": [ 2125 | "### Formating DataFrame columns\n", 2126 | "The BMI column values of the DataFrame are float with many significant digits after decimal. Let's change it to one significant digit after point." 2127 | ] 2128 | }, 2129 | { 2130 | "cell_type": "code", 2131 | "execution_count": 458, 2132 | "metadata": {}, 2133 | "outputs": [ 2134 | { 2135 | "data": { 2136 | "text/html": [ 2137 | "
\n", 2138 | "\n", 2151 | "\n", 2152 | " \n", 2153 | " \n", 2154 | " \n", 2155 | " \n", 2156 | " \n", 2157 | " \n", 2158 | " \n", 2159 | " \n", 2160 | " \n", 2161 | " \n", 2162 | " \n", 2163 | " \n", 2164 | " \n", 2165 | " \n", 2166 | " \n", 2167 | " \n", 2168 | " \n", 2169 | " \n", 2170 | " \n", 2171 | " \n", 2172 | " \n", 2173 | " \n", 2174 | " \n", 2175 | " \n", 2176 | " \n", 2177 | " \n", 2178 | " \n", 2179 | " \n", 2180 | " \n", 2181 | " \n", 2182 | " \n", 2183 | " \n", 2184 | " \n", 2185 | " \n", 2186 | " \n", 2187 | " \n", 2188 | " \n", 2189 | " \n", 2190 | " \n", 2191 | " \n", 2192 | " \n", 2193 | " \n", 2194 | " \n", 2195 | " \n", 2196 | " \n", 2197 | " \n", 2198 | " \n", 2199 | " \n", 2200 | " \n", 2201 | " \n", 2202 | " \n", 2203 | " \n", 2204 | " \n", 2205 | " \n", 2206 | " \n", 2207 | " \n", 2208 | " \n", 2209 | " \n", 2210 | " \n", 2211 | " \n", 2212 | " \n", 2213 | " \n", 2214 | " \n", 2215 | " \n", 2216 | " \n", 2217 | " \n", 2218 | " \n", 2219 | "
NameCountryCityWeightHeightBMI
0AsabenehFinlandHelsinki74.01.7324.7
1DavidUKLondon78.01.7525.5
2JohnSwedenStockholm69.01.6924.2
3EyobFinlandEspoo71.01.7323.7
4PawelPolandWarsaw102.01.9526.8
5LidiyaNaNNaNNaNNaNNaN
\n", 2220 | "
" 2221 | ], 2222 | "text/plain": [ 2223 | " Name Country City Weight Height BMI\n", 2224 | "0 Asabeneh Finland Helsinki 74.0 1.73 24.7\n", 2225 | "1 David UK London 78.0 1.75 25.5\n", 2226 | "2 John Sweden Stockholm 69.0 1.69 24.2\n", 2227 | "3 Eyob Finland Espoo 71.0 1.73 23.7\n", 2228 | "4 Pawel Poland Warsaw 102.0 1.95 26.8\n", 2229 | "5 Lidiya NaN NaN NaN NaN NaN" 2230 | ] 2231 | }, 2232 | "execution_count": 458, 2233 | "metadata": {}, 2234 | "output_type": "execute_result" 2235 | } 2236 | ], 2237 | "source": [ 2238 | "df['BMI'] = round(df['BMI'], 1)\n", 2239 | "df" 2240 | ] 2241 | }, 2242 | { 2243 | "cell_type": "markdown", 2244 | "metadata": {}, 2245 | "source": [ 2246 | "\n", 2247 | "The information in the DataFrame seems not yet complete, let's add birth year and current year columns." 2248 | ] 2249 | }, 2250 | { 2251 | "cell_type": "code", 2252 | "execution_count": 459, 2253 | "metadata": {}, 2254 | "outputs": [ 2255 | { 2256 | "data": { 2257 | "text/html": [ 2258 | "
\n", 2259 | "\n", 2272 | "\n", 2273 | " \n", 2274 | " \n", 2275 | " \n", 2276 | " \n", 2277 | " \n", 2278 | " \n", 2279 | " \n", 2280 | " \n", 2281 | " \n", 2282 | " \n", 2283 | " \n", 2284 | " \n", 2285 | " \n", 2286 | " \n", 2287 | " \n", 2288 | " \n", 2289 | " \n", 2290 | " \n", 2291 | " \n", 2292 | " \n", 2293 | " \n", 2294 | " \n", 2295 | " \n", 2296 | " \n", 2297 | " \n", 2298 | " \n", 2299 | " \n", 2300 | " \n", 2301 | " \n", 2302 | " \n", 2303 | " \n", 2304 | " \n", 2305 | " \n", 2306 | " \n", 2307 | " \n", 2308 | " \n", 2309 | " \n", 2310 | " \n", 2311 | " \n", 2312 | " \n", 2313 | " \n", 2314 | " \n", 2315 | " \n", 2316 | " \n", 2317 | " \n", 2318 | " \n", 2319 | " \n", 2320 | " \n", 2321 | " \n", 2322 | " \n", 2323 | " \n", 2324 | " \n", 2325 | " \n", 2326 | " \n", 2327 | " \n", 2328 | " \n", 2329 | " \n", 2330 | " \n", 2331 | " \n", 2332 | " \n", 2333 | " \n", 2334 | " \n", 2335 | " \n", 2336 | " \n", 2337 | " \n", 2338 | " \n", 2339 | " \n", 2340 | " \n", 2341 | " \n", 2342 | " \n", 2343 | " \n", 2344 | " \n", 2345 | " \n", 2346 | " \n", 2347 | " \n", 2348 | " \n", 2349 | " \n", 2350 | " \n", 2351 | " \n", 2352 | " \n", 2353 | " \n", 2354 | "
NameCountryCityWeightHeightBMIBirth YearCurrent Year
0AsabenehFinlandHelsinki74.01.7324.717692020.0
1DavidUKLondon78.01.7525.519852020.0
2JohnSwedenStockholm69.01.6924.219902020.0
3EyobFinlandEspoo71.01.7323.719832020.0
4PawelPolandWarsaw102.01.9526.819852020.0
5LidiyaNaNNaNNaNNaNNaNNaNNaN
\n", 2355 | "
" 2356 | ], 2357 | "text/plain": [ 2358 | " Name Country City Weight Height BMI Birth Year Current Year\n", 2359 | "0 Asabeneh Finland Helsinki 74.0 1.73 24.7 1769 2020.0\n", 2360 | "1 David UK London 78.0 1.75 25.5 1985 2020.0\n", 2361 | "2 John Sweden Stockholm 69.0 1.69 24.2 1990 2020.0\n", 2362 | "3 Eyob Finland Espoo 71.0 1.73 23.7 1983 2020.0\n", 2363 | "4 Pawel Poland Warsaw 102.0 1.95 26.8 1985 2020.0\n", 2364 | "5 Lidiya NaN NaN NaN NaN NaN NaN NaN" 2365 | ] 2366 | }, 2367 | "execution_count": 459, 2368 | "metadata": {}, 2369 | "output_type": "execute_result" 2370 | } 2371 | ], 2372 | "source": [ 2373 | "birth_year = ['1769', '1985', '1990', '1983', '1985',float('NaN')]\n", 2374 | "df['Birth Year'] = birth_year\n", 2375 | "df['Current Year'] = current_year\n", 2376 | "df" 2377 | ] 2378 | }, 2379 | { 2380 | "cell_type": "markdown", 2381 | "metadata": {}, 2382 | "source": [ 2383 | "### Deleting a DataFrame Column\n", 2384 | "#### Deleting Columns\n", 2385 | "\n", 2386 | "To delete a DataFrame column(s), we use the name of the columns and the axis as 1. " 2387 | ] 2388 | }, 2389 | { 2390 | "cell_type": "code", 2391 | "execution_count": 460, 2392 | "metadata": {}, 2393 | "outputs": [ 2394 | { 2395 | "data": { 2396 | "text/html": [ 2397 | "
\n", 2398 | "\n", 2411 | "\n", 2412 | " \n", 2413 | " \n", 2414 | " \n", 2415 | " \n", 2416 | " \n", 2417 | " \n", 2418 | " \n", 2419 | " \n", 2420 | " \n", 2421 | " \n", 2422 | " \n", 2423 | " \n", 2424 | " \n", 2425 | " \n", 2426 | " \n", 2427 | " \n", 2428 | " \n", 2429 | " \n", 2430 | " \n", 2431 | " \n", 2432 | " \n", 2433 | " \n", 2434 | " \n", 2435 | " \n", 2436 | " \n", 2437 | " \n", 2438 | " \n", 2439 | " \n", 2440 | " \n", 2441 | " \n", 2442 | " \n", 2443 | " \n", 2444 | " \n", 2445 | " \n", 2446 | " \n", 2447 | " \n", 2448 | " \n", 2449 | " \n", 2450 | " \n", 2451 | " \n", 2452 | " \n", 2453 | " \n", 2454 | " \n", 2455 | " \n", 2456 | " \n", 2457 | " \n", 2458 | " \n", 2459 | " \n", 2460 | " \n", 2461 | " \n", 2462 | " \n", 2463 | " \n", 2464 | " \n", 2465 | " \n", 2466 | " \n", 2467 | " \n", 2468 | " \n", 2469 | " \n", 2470 | " \n", 2471 | " \n", 2472 | " \n", 2473 | " \n", 2474 | " \n", 2475 | " \n", 2476 | " \n", 2477 | " \n", 2478 | " \n", 2479 | " \n", 2480 | " \n", 2481 | " \n", 2482 | " \n", 2483 | " \n", 2484 | " \n", 2485 | " \n", 2486 | "
CountryCityWeightHeightBMIBirth YearCurrent Year
0FinlandHelsinki74.01.7324.717692020.0
1UKLondon78.01.7525.519852020.0
2SwedenStockholm69.01.6924.219902020.0
3FinlandEspoo71.01.7323.719832020.0
4PolandWarsaw102.01.9526.819852020.0
5NaNNaNNaNNaNNaNNaNNaN
\n", 2487 | "
" 2488 | ], 2489 | "text/plain": [ 2490 | " Country City Weight Height BMI Birth Year Current Year\n", 2491 | "0 Finland Helsinki 74.0 1.73 24.7 1769 2020.0\n", 2492 | "1 UK London 78.0 1.75 25.5 1985 2020.0\n", 2493 | "2 Sweden Stockholm 69.0 1.69 24.2 1990 2020.0\n", 2494 | "3 Finland Espoo 71.0 1.73 23.7 1983 2020.0\n", 2495 | "4 Poland Warsaw 102.0 1.95 26.8 1985 2020.0\n", 2496 | "5 NaN NaN NaN NaN NaN NaN NaN" 2497 | ] 2498 | }, 2499 | "execution_count": 460, 2500 | "metadata": {}, 2501 | "output_type": "execute_result" 2502 | } 2503 | ], 2504 | "source": [ 2505 | "# Let us imagine the Name column is not important.\n", 2506 | "# This does not affect the original data frame. To change from the original data frame we should add the inpplace argument\n", 2507 | "df.drop('Name', axis=1)" 2508 | ] 2509 | }, 2510 | { 2511 | "cell_type": "code", 2512 | "execution_count": 461, 2513 | "metadata": {}, 2514 | "outputs": [ 2515 | { 2516 | "data": { 2517 | "text/html": [ 2518 | "
\n", 2519 | "\n", 2532 | "\n", 2533 | " \n", 2534 | " \n", 2535 | " \n", 2536 | " \n", 2537 | " \n", 2538 | " \n", 2539 | " \n", 2540 | " \n", 2541 | " \n", 2542 | " \n", 2543 | " \n", 2544 | " \n", 2545 | " \n", 2546 | " \n", 2547 | " \n", 2548 | " \n", 2549 | " \n", 2550 | " \n", 2551 | " \n", 2552 | " \n", 2553 | " \n", 2554 | " \n", 2555 | " \n", 2556 | " \n", 2557 | " \n", 2558 | " \n", 2559 | " \n", 2560 | " \n", 2561 | " \n", 2562 | " \n", 2563 | " \n", 2564 | " \n", 2565 | " \n", 2566 | " \n", 2567 | " \n", 2568 | " \n", 2569 | " \n", 2570 | " \n", 2571 | " \n", 2572 | " \n", 2573 | " \n", 2574 | " \n", 2575 | " \n", 2576 | " \n", 2577 | " \n", 2578 | " \n", 2579 | " \n", 2580 | " \n", 2581 | " \n", 2582 | " \n", 2583 | " \n", 2584 | " \n", 2585 | " \n", 2586 | " \n", 2587 | " \n", 2588 | " \n", 2589 | " \n", 2590 | " \n", 2591 | " \n", 2592 | " \n", 2593 | " \n", 2594 | " \n", 2595 | " \n", 2596 | " \n", 2597 | " \n", 2598 | " \n", 2599 | " \n", 2600 | " \n", 2601 | " \n", 2602 | " \n", 2603 | " \n", 2604 | " \n", 2605 | " \n", 2606 | " \n", 2607 | " \n", 2608 | " \n", 2609 | " \n", 2610 | " \n", 2611 | " \n", 2612 | " \n", 2613 | " \n", 2614 | "
NameCountryCityWeightHeightBMIBirth YearCurrent Year
0AsabenehFinlandHelsinki74.01.7324.717692020.0
1DavidUKLondon78.01.7525.519852020.0
2JohnSwedenStockholm69.01.6924.219902020.0
3EyobFinlandEspoo71.01.7323.719832020.0
4PawelPolandWarsaw102.01.9526.819852020.0
5LidiyaNaNNaNNaNNaNNaNNaNNaN
\n", 2615 | "
" 2616 | ], 2617 | "text/plain": [ 2618 | " Name Country City Weight Height BMI Birth Year Current Year\n", 2619 | "0 Asabeneh Finland Helsinki 74.0 1.73 24.7 1769 2020.0\n", 2620 | "1 David UK London 78.0 1.75 25.5 1985 2020.0\n", 2621 | "2 John Sweden Stockholm 69.0 1.69 24.2 1990 2020.0\n", 2622 | "3 Eyob Finland Espoo 71.0 1.73 23.7 1983 2020.0\n", 2623 | "4 Pawel Poland Warsaw 102.0 1.95 26.8 1985 2020.0\n", 2624 | "5 Lidiya NaN NaN NaN NaN NaN NaN NaN" 2625 | ] 2626 | }, 2627 | "execution_count": 461, 2628 | "metadata": {}, 2629 | "output_type": "execute_result" 2630 | } 2631 | ], 2632 | "source": [ 2633 | "#The original dataframe has not beeen changes\n", 2634 | "df" 2635 | ] 2636 | }, 2637 | { 2638 | "cell_type": "code", 2639 | "execution_count": 462, 2640 | "metadata": {}, 2641 | "outputs": [ 2642 | { 2643 | "data": { 2644 | "text/html": [ 2645 | "
\n", 2646 | "\n", 2659 | "\n", 2660 | " \n", 2661 | " \n", 2662 | " \n", 2663 | " \n", 2664 | " \n", 2665 | " \n", 2666 | " \n", 2667 | " \n", 2668 | " \n", 2669 | " \n", 2670 | " \n", 2671 | " \n", 2672 | " \n", 2673 | " \n", 2674 | " \n", 2675 | " \n", 2676 | " \n", 2677 | " \n", 2678 | " \n", 2679 | " \n", 2680 | " \n", 2681 | " \n", 2682 | " \n", 2683 | " \n", 2684 | " \n", 2685 | " \n", 2686 | " \n", 2687 | " \n", 2688 | " \n", 2689 | " \n", 2690 | " \n", 2691 | " \n", 2692 | " \n", 2693 | " \n", 2694 | " \n", 2695 | " \n", 2696 | " \n", 2697 | " \n", 2698 | " \n", 2699 | " \n", 2700 | " \n", 2701 | " \n", 2702 | " \n", 2703 | " \n", 2704 | " \n", 2705 | " \n", 2706 | " \n", 2707 | " \n", 2708 | " \n", 2709 | " \n", 2710 | " \n", 2711 | " \n", 2712 | " \n", 2713 | " \n", 2714 | " \n", 2715 | " \n", 2716 | " \n", 2717 | " \n", 2718 | " \n", 2719 | " \n", 2720 | " \n", 2721 | " \n", 2722 | " \n", 2723 | " \n", 2724 | " \n", 2725 | " \n", 2726 | " \n", 2727 | " \n", 2728 | " \n", 2729 | " \n", 2730 | " \n", 2731 | " \n", 2732 | " \n", 2733 | " \n", 2734 | "
CountryCityWeightHeightBMIBirth YearCurrent Year
0FinlandHelsinki74.01.7324.717692020.0
1UKLondon78.01.7525.519852020.0
2SwedenStockholm69.01.6924.219902020.0
3FinlandEspoo71.01.7323.719832020.0
4PolandWarsaw102.01.9526.819852020.0
5NaNNaNNaNNaNNaNNaNNaN
\n", 2735 | "
" 2736 | ], 2737 | "text/plain": [ 2738 | " Country City Weight Height BMI Birth Year Current Year\n", 2739 | "0 Finland Helsinki 74.0 1.73 24.7 1769 2020.0\n", 2740 | "1 UK London 78.0 1.75 25.5 1985 2020.0\n", 2741 | "2 Sweden Stockholm 69.0 1.69 24.2 1990 2020.0\n", 2742 | "3 Finland Espoo 71.0 1.73 23.7 1983 2020.0\n", 2743 | "4 Poland Warsaw 102.0 1.95 26.8 1985 2020.0\n", 2744 | "5 NaN NaN NaN NaN NaN NaN NaN" 2745 | ] 2746 | }, 2747 | "execution_count": 462, 2748 | "metadata": {}, 2749 | "output_type": "execute_result" 2750 | } 2751 | ], 2752 | "source": [ 2753 | "# Let us imagine the Name column is not important.\n", 2754 | "# This does not affect the original data frame. To change from the original data frame we should add the inpplace argument\n", 2755 | "df.drop('Name', axis=1, inplace=True)\n", 2756 | "df" 2757 | ] 2758 | }, 2759 | { 2760 | "cell_type": "code", 2761 | "execution_count": 463, 2762 | "metadata": {}, 2763 | "outputs": [ 2764 | { 2765 | "data": { 2766 | "text/html": [ 2767 | "
\n", 2768 | "\n", 2781 | "\n", 2782 | " \n", 2783 | " \n", 2784 | " \n", 2785 | " \n", 2786 | " \n", 2787 | " \n", 2788 | " \n", 2789 | " \n", 2790 | " \n", 2791 | " \n", 2792 | " \n", 2793 | " \n", 2794 | " \n", 2795 | " \n", 2796 | " \n", 2797 | " \n", 2798 | " \n", 2799 | " \n", 2800 | " \n", 2801 | " \n", 2802 | " \n", 2803 | " \n", 2804 | " \n", 2805 | " \n", 2806 | " \n", 2807 | " \n", 2808 | " \n", 2809 | " \n", 2810 | " \n", 2811 | " \n", 2812 | " \n", 2813 | " \n", 2814 | " \n", 2815 | " \n", 2816 | " \n", 2817 | " \n", 2818 | " \n", 2819 | " \n", 2820 | " \n", 2821 | " \n", 2822 | " \n", 2823 | " \n", 2824 | " \n", 2825 | " \n", 2826 | " \n", 2827 | " \n", 2828 | " \n", 2829 | " \n", 2830 | " \n", 2831 | " \n", 2832 | " \n", 2833 | " \n", 2834 | " \n", 2835 | " \n", 2836 | " \n", 2837 | " \n", 2838 | " \n", 2839 | " \n", 2840 | " \n", 2841 | " \n", 2842 | " \n", 2843 | " \n", 2844 | " \n", 2845 | " \n", 2846 | " \n", 2847 | " \n", 2848 | " \n", 2849 | "
CityWeightHeightBMIBirth YearCurrent Year
0Helsinki74.01.7324.717692020.0
1London78.01.7525.519852020.0
2Stockholm69.01.6924.219902020.0
3Espoo71.01.7323.719832020.0
4Warsaw102.01.9526.819852020.0
5NaNNaNNaNNaNNaNNaN
\n", 2850 | "
" 2851 | ], 2852 | "text/plain": [ 2853 | " City Weight Height BMI Birth Year Current Year\n", 2854 | "0 Helsinki 74.0 1.73 24.7 1769 2020.0\n", 2855 | "1 London 78.0 1.75 25.5 1985 2020.0\n", 2856 | "2 Stockholm 69.0 1.69 24.2 1990 2020.0\n", 2857 | "3 Espoo 71.0 1.73 23.7 1983 2020.0\n", 2858 | "4 Warsaw 102.0 1.95 26.8 1985 2020.0\n", 2859 | "5 NaN NaN NaN NaN NaN NaN" 2860 | ] 2861 | }, 2862 | "execution_count": 463, 2863 | "metadata": {}, 2864 | "output_type": "execute_result" 2865 | } 2866 | ], 2867 | "source": [ 2868 | "# We can also use the columns attribute to delete a column. Let us remove the country column\n", 2869 | "# To change the original we should make the inplace argument True\n", 2870 | "df.drop(columns = 'Country', axis=1)" 2871 | ] 2872 | }, 2873 | { 2874 | "cell_type": "code", 2875 | "execution_count": 464, 2876 | "metadata": {}, 2877 | "outputs": [ 2878 | { 2879 | "data": { 2880 | "text/html": [ 2881 | "
\n", 2882 | "\n", 2895 | "\n", 2896 | " \n", 2897 | " \n", 2898 | " \n", 2899 | " \n", 2900 | " \n", 2901 | " \n", 2902 | " \n", 2903 | " \n", 2904 | " \n", 2905 | " \n", 2906 | " \n", 2907 | " \n", 2908 | " \n", 2909 | " \n", 2910 | " \n", 2911 | " \n", 2912 | " \n", 2913 | " \n", 2914 | " \n", 2915 | " \n", 2916 | " \n", 2917 | " \n", 2918 | " \n", 2919 | " \n", 2920 | " \n", 2921 | " \n", 2922 | " \n", 2923 | " \n", 2924 | " \n", 2925 | " \n", 2926 | " \n", 2927 | " \n", 2928 | " \n", 2929 | " \n", 2930 | " \n", 2931 | " \n", 2932 | " \n", 2933 | " \n", 2934 | " \n", 2935 | " \n", 2936 | " \n", 2937 | " \n", 2938 | " \n", 2939 | " \n", 2940 | " \n", 2941 | " \n", 2942 | " \n", 2943 | " \n", 2944 | " \n", 2945 | " \n", 2946 | " \n", 2947 | " \n", 2948 | " \n", 2949 | " \n", 2950 | " \n", 2951 | " \n", 2952 | " \n", 2953 | " \n", 2954 | " \n", 2955 | " \n", 2956 | "
WeightHeightBMIBirth YearCurrent Year
074.01.7324.717692020.0
178.01.7525.519852020.0
269.01.6924.219902020.0
371.01.7323.719832020.0
4102.01.9526.819852020.0
5NaNNaNNaNNaNNaN
\n", 2957 | "
" 2958 | ], 2959 | "text/plain": [ 2960 | " Weight Height BMI Birth Year Current Year\n", 2961 | "0 74.0 1.73 24.7 1769 2020.0\n", 2962 | "1 78.0 1.75 25.5 1985 2020.0\n", 2963 | "2 69.0 1.69 24.2 1990 2020.0\n", 2964 | "3 71.0 1.73 23.7 1983 2020.0\n", 2965 | "4 102.0 1.95 26.8 1985 2020.0\n", 2966 | "5 NaN NaN NaN NaN NaN" 2967 | ] 2968 | }, 2969 | "execution_count": 464, 2970 | "metadata": {}, 2971 | "output_type": "execute_result" 2972 | } 2973 | ], 2974 | "source": [ 2975 | "#### Removing multiple columns\n", 2976 | "df.drop(['Country','City'], axis=1)" 2977 | ] 2978 | }, 2979 | { 2980 | "cell_type": "markdown", 2981 | "metadata": {}, 2982 | "source": [ 2983 | "### Deleting Rows\n", 2984 | "\n", 2985 | "The fifth row does not have full information and it is not important to keep in the dataset. Let's remove the fifth row." 2986 | ] 2987 | }, 2988 | { 2989 | "cell_type": "code", 2990 | "execution_count": 465, 2991 | "metadata": {}, 2992 | "outputs": [ 2993 | { 2994 | "data": { 2995 | "text/html": [ 2996 | "
\n", 2997 | "\n", 3010 | "\n", 3011 | " \n", 3012 | " \n", 3013 | " \n", 3014 | " \n", 3015 | " \n", 3016 | " \n", 3017 | " \n", 3018 | " \n", 3019 | " \n", 3020 | " \n", 3021 | " \n", 3022 | " \n", 3023 | " \n", 3024 | " \n", 3025 | " \n", 3026 | " \n", 3027 | " \n", 3028 | " \n", 3029 | " \n", 3030 | " \n", 3031 | " \n", 3032 | " \n", 3033 | " \n", 3034 | " \n", 3035 | " \n", 3036 | " \n", 3037 | " \n", 3038 | " \n", 3039 | " \n", 3040 | " \n", 3041 | " \n", 3042 | " \n", 3043 | " \n", 3044 | " \n", 3045 | " \n", 3046 | " \n", 3047 | " \n", 3048 | " \n", 3049 | " \n", 3050 | " \n", 3051 | " \n", 3052 | " \n", 3053 | " \n", 3054 | " \n", 3055 | " \n", 3056 | " \n", 3057 | " \n", 3058 | " \n", 3059 | " \n", 3060 | " \n", 3061 | " \n", 3062 | " \n", 3063 | " \n", 3064 | " \n", 3065 | " \n", 3066 | " \n", 3067 | " \n", 3068 | " \n", 3069 | " \n", 3070 | " \n", 3071 | " \n", 3072 | " \n", 3073 | " \n", 3074 | " \n", 3075 | "
CountryCityWeightHeightBMIBirth YearCurrent Year
0FinlandHelsinki74.01.7324.717692020.0
1UKLondon78.01.7525.519852020.0
2SwedenStockholm69.01.6924.219902020.0
3FinlandEspoo71.01.7323.719832020.0
4PolandWarsaw102.01.9526.819852020.0
\n", 3076 | "
" 3077 | ], 3078 | "text/plain": [ 3079 | " Country City Weight Height BMI Birth Year Current Year\n", 3080 | "0 Finland Helsinki 74.0 1.73 24.7 1769 2020.0\n", 3081 | "1 UK London 78.0 1.75 25.5 1985 2020.0\n", 3082 | "2 Sweden Stockholm 69.0 1.69 24.2 1990 2020.0\n", 3083 | "3 Finland Espoo 71.0 1.73 23.7 1983 2020.0\n", 3084 | "4 Poland Warsaw 102.0 1.95 26.8 1985 2020.0" 3085 | ] 3086 | }, 3087 | "execution_count": 465, 3088 | "metadata": {}, 3089 | "output_type": "execute_result" 3090 | } 3091 | ], 3092 | "source": [ 3093 | "# To delete it from the original dataframe the inplace=True should be included\n", 3094 | "df.drop([5,5], axis=0)" 3095 | ] 3096 | }, 3097 | { 3098 | "cell_type": "code", 3099 | "execution_count": 466, 3100 | "metadata": {}, 3101 | "outputs": [ 3102 | { 3103 | "data": { 3104 | "text/html": [ 3105 | "
\n", 3106 | "\n", 3119 | "\n", 3120 | " \n", 3121 | " \n", 3122 | " \n", 3123 | " \n", 3124 | " \n", 3125 | " \n", 3126 | " \n", 3127 | " \n", 3128 | " \n", 3129 | " \n", 3130 | " \n", 3131 | " \n", 3132 | " \n", 3133 | " \n", 3134 | " \n", 3135 | " \n", 3136 | " \n", 3137 | " \n", 3138 | " \n", 3139 | " \n", 3140 | " \n", 3141 | " \n", 3142 | " \n", 3143 | " \n", 3144 | " \n", 3145 | " \n", 3146 | " \n", 3147 | " \n", 3148 | " \n", 3149 | " \n", 3150 | " \n", 3151 | " \n", 3152 | " \n", 3153 | " \n", 3154 | " \n", 3155 | " \n", 3156 | " \n", 3157 | " \n", 3158 | " \n", 3159 | " \n", 3160 | " \n", 3161 | " \n", 3162 | " \n", 3163 | " \n", 3164 | " \n", 3165 | " \n", 3166 | " \n", 3167 | " \n", 3168 | " \n", 3169 | " \n", 3170 | " \n", 3171 | " \n", 3172 | " \n", 3173 | " \n", 3174 | " \n", 3175 | " \n", 3176 | " \n", 3177 | " \n", 3178 | " \n", 3179 | " \n", 3180 | " \n", 3181 | " \n", 3182 | " \n", 3183 | " \n", 3184 | " \n", 3185 | " \n", 3186 | " \n", 3187 | " \n", 3188 | " \n", 3189 | " \n", 3190 | " \n", 3191 | " \n", 3192 | " \n", 3193 | " \n", 3194 | "
CountryCityWeightHeightBMIBirth YearCurrent Year
0FinlandHelsinki74.01.7324.717692020.0
1UKLondon78.01.7525.519852020.0
2SwedenStockholm69.01.6924.219902020.0
3FinlandEspoo71.01.7323.719832020.0
4PolandWarsaw102.01.9526.819852020.0
5NaNNaNNaNNaNNaNNaNNaN
\n", 3195 | "
" 3196 | ], 3197 | "text/plain": [ 3198 | " Country City Weight Height BMI Birth Year Current Year\n", 3199 | "0 Finland Helsinki 74.0 1.73 24.7 1769 2020.0\n", 3200 | "1 UK London 78.0 1.75 25.5 1985 2020.0\n", 3201 | "2 Sweden Stockholm 69.0 1.69 24.2 1990 2020.0\n", 3202 | "3 Finland Espoo 71.0 1.73 23.7 1983 2020.0\n", 3203 | "4 Poland Warsaw 102.0 1.95 26.8 1985 2020.0\n", 3204 | "5 NaN NaN NaN NaN NaN NaN NaN" 3205 | ] 3206 | }, 3207 | "execution_count": 466, 3208 | "metadata": {}, 3209 | "output_type": "execute_result" 3210 | } 3211 | ], 3212 | "source": [ 3213 | "df" 3214 | ] 3215 | }, 3216 | { 3217 | "cell_type": "markdown", 3218 | "metadata": {}, 3219 | "source": [ 3220 | "### Renaming Columns" 3221 | ] 3222 | }, 3223 | { 3224 | "cell_type": "code", 3225 | "execution_count": 467, 3226 | "metadata": {}, 3227 | "outputs": [ 3228 | { 3229 | "data": { 3230 | "text/html": [ 3231 | "
\n", 3232 | "\n", 3245 | "\n", 3246 | " \n", 3247 | " \n", 3248 | " \n", 3249 | " \n", 3250 | " \n", 3251 | " \n", 3252 | " \n", 3253 | " \n", 3254 | " \n", 3255 | " \n", 3256 | " \n", 3257 | " \n", 3258 | " \n", 3259 | " \n", 3260 | " \n", 3261 | " \n", 3262 | " \n", 3263 | " \n", 3264 | " \n", 3265 | " \n", 3266 | " \n", 3267 | " \n", 3268 | " \n", 3269 | " \n", 3270 | " \n", 3271 | " \n", 3272 | " \n", 3273 | " \n", 3274 | " \n", 3275 | " \n", 3276 | " \n", 3277 | " \n", 3278 | " \n", 3279 | " \n", 3280 | " \n", 3281 | " \n", 3282 | " \n", 3283 | " \n", 3284 | " \n", 3285 | " \n", 3286 | " \n", 3287 | " \n", 3288 | " \n", 3289 | " \n", 3290 | " \n", 3291 | " \n", 3292 | " \n", 3293 | " \n", 3294 | " \n", 3295 | " \n", 3296 | " \n", 3297 | " \n", 3298 | " \n", 3299 | " \n", 3300 | " \n", 3301 | " \n", 3302 | " \n", 3303 | " \n", 3304 | " \n", 3305 | " \n", 3306 | " \n", 3307 | " \n", 3308 | " \n", 3309 | " \n", 3310 | " \n", 3311 | " \n", 3312 | " \n", 3313 | " \n", 3314 | " \n", 3315 | " \n", 3316 | " \n", 3317 | " \n", 3318 | " \n", 3319 | " \n", 3320 | "
countrycityweightheightbmibirth_yearcurrent_year
0FinlandHelsinki74.01.7324.717692020.0
1UKLondon78.01.7525.519852020.0
2SwedenStockholm69.01.6924.219902020.0
3FinlandEspoo71.01.7323.719832020.0
4PolandWarsaw102.01.9526.819852020.0
5NaNNaNNaNNaNNaNNaNNaN
\n", 3321 | "
" 3322 | ], 3323 | "text/plain": [ 3324 | " country city weight height bmi birth_year current_year\n", 3325 | "0 Finland Helsinki 74.0 1.73 24.7 1769 2020.0\n", 3326 | "1 UK London 78.0 1.75 25.5 1985 2020.0\n", 3327 | "2 Sweden Stockholm 69.0 1.69 24.2 1990 2020.0\n", 3328 | "3 Finland Espoo 71.0 1.73 23.7 1983 2020.0\n", 3329 | "4 Poland Warsaw 102.0 1.95 26.8 1985 2020.0\n", 3330 | "5 NaN NaN NaN NaN NaN NaN NaN" 3331 | ] 3332 | }, 3333 | "execution_count": 467, 3334 | "metadata": {}, 3335 | "output_type": "execute_result" 3336 | } 3337 | ], 3338 | "source": [ 3339 | "# To modifiy original dataframe the inplace=True should be included\n", 3340 | "df.rename(\n", 3341 | " columns={\n", 3342 | " \"Country\": \"country\",\n", 3343 | " \"City\": \"city\",\n", 3344 | " \"Weight\":\"weight\",\n", 3345 | " \"Height\":\"height\",\n", 3346 | " \"BMI\":'bmi',\n", 3347 | " 'Birth Year':'birth_year',\n", 3348 | " 'Current Year':'current_year'\n", 3349 | " }\n", 3350 | ")" 3351 | ] 3352 | }, 3353 | { 3354 | "cell_type": "code", 3355 | "execution_count": 468, 3356 | "metadata": {}, 3357 | "outputs": [ 3358 | { 3359 | "data": { 3360 | "text/html": [ 3361 | "
\n", 3362 | "\n", 3375 | "\n", 3376 | " \n", 3377 | " \n", 3378 | " \n", 3379 | " \n", 3380 | " \n", 3381 | " \n", 3382 | " \n", 3383 | " \n", 3384 | " \n", 3385 | " \n", 3386 | " \n", 3387 | " \n", 3388 | " \n", 3389 | " \n", 3390 | " \n", 3391 | " \n", 3392 | " \n", 3393 | " \n", 3394 | " \n", 3395 | " \n", 3396 | " \n", 3397 | " \n", 3398 | " \n", 3399 | " \n", 3400 | " \n", 3401 | " \n", 3402 | " \n", 3403 | " \n", 3404 | " \n", 3405 | " \n", 3406 | " \n", 3407 | " \n", 3408 | " \n", 3409 | " \n", 3410 | " \n", 3411 | " \n", 3412 | " \n", 3413 | " \n", 3414 | " \n", 3415 | " \n", 3416 | " \n", 3417 | " \n", 3418 | " \n", 3419 | " \n", 3420 | " \n", 3421 | " \n", 3422 | " \n", 3423 | " \n", 3424 | " \n", 3425 | " \n", 3426 | " \n", 3427 | " \n", 3428 | " \n", 3429 | " \n", 3430 | " \n", 3431 | " \n", 3432 | " \n", 3433 | " \n", 3434 | " \n", 3435 | " \n", 3436 | " \n", 3437 | " \n", 3438 | " \n", 3439 | " \n", 3440 | " \n", 3441 | " \n", 3442 | " \n", 3443 | " \n", 3444 | " \n", 3445 | " \n", 3446 | " \n", 3447 | " \n", 3448 | " \n", 3449 | " \n", 3450 | "
countrycityweightheightbmibirth yearcurrent year
0FinlandHelsinki74.01.7324.717692020.0
1UKLondon78.01.7525.519852020.0
2SwedenStockholm69.01.6924.219902020.0
3FinlandEspoo71.01.7323.719832020.0
4PolandWarsaw102.01.9526.819852020.0
5NaNNaNNaNNaNNaNNaNNaN
\n", 3451 | "
" 3452 | ], 3453 | "text/plain": [ 3454 | " country city weight height bmi birth year current year\n", 3455 | "0 Finland Helsinki 74.0 1.73 24.7 1769 2020.0\n", 3456 | "1 UK London 78.0 1.75 25.5 1985 2020.0\n", 3457 | "2 Sweden Stockholm 69.0 1.69 24.2 1990 2020.0\n", 3458 | "3 Finland Espoo 71.0 1.73 23.7 1983 2020.0\n", 3459 | "4 Poland Warsaw 102.0 1.95 26.8 1985 2020.0\n", 3460 | "5 NaN NaN NaN NaN NaN NaN NaN" 3461 | ] 3462 | }, 3463 | "execution_count": 468, 3464 | "metadata": {}, 3465 | "output_type": "execute_result" 3466 | } 3467 | ], 3468 | "source": [ 3469 | "df.rename(columns=str.lower)" 3470 | ] 3471 | }, 3472 | { 3473 | "cell_type": "code", 3474 | "execution_count": 469, 3475 | "metadata": {}, 3476 | "outputs": [ 3477 | { 3478 | "data": { 3479 | "text/html": [ 3480 | "
\n", 3481 | "\n", 3494 | "\n", 3495 | " \n", 3496 | " \n", 3497 | " \n", 3498 | " \n", 3499 | " \n", 3500 | " \n", 3501 | " \n", 3502 | " \n", 3503 | " \n", 3504 | " \n", 3505 | " \n", 3506 | " \n", 3507 | " \n", 3508 | " \n", 3509 | " \n", 3510 | " \n", 3511 | " \n", 3512 | " \n", 3513 | " \n", 3514 | " \n", 3515 | " \n", 3516 | " \n", 3517 | " \n", 3518 | " \n", 3519 | " \n", 3520 | " \n", 3521 | " \n", 3522 | " \n", 3523 | " \n", 3524 | " \n", 3525 | " \n", 3526 | " \n", 3527 | " \n", 3528 | " \n", 3529 | " \n", 3530 | " \n", 3531 | " \n", 3532 | " \n", 3533 | " \n", 3534 | " \n", 3535 | " \n", 3536 | " \n", 3537 | " \n", 3538 | " \n", 3539 | " \n", 3540 | " \n", 3541 | " \n", 3542 | " \n", 3543 | " \n", 3544 | " \n", 3545 | " \n", 3546 | " \n", 3547 | " \n", 3548 | " \n", 3549 | " \n", 3550 | " \n", 3551 | " \n", 3552 | " \n", 3553 | " \n", 3554 | " \n", 3555 | " \n", 3556 | " \n", 3557 | " \n", 3558 | " \n", 3559 | " \n", 3560 | " \n", 3561 | " \n", 3562 | " \n", 3563 | " \n", 3564 | " \n", 3565 | " \n", 3566 | " \n", 3567 | " \n", 3568 | " \n", 3569 | "
CountryCityWeightHeightBMIBirth YearCurrent Year
0FinlandHelsinki74.01.7324.717692020.0
1UKLondon78.01.7525.519852020.0
2SwedenStockholm69.01.6924.219902020.0
3FinlandEspoo71.01.7323.719832020.0
4PolandWarsaw102.01.9526.819852020.0
5NaNNaNNaNNaNNaNNaNNaN
\n", 3570 | "
" 3571 | ], 3572 | "text/plain": [ 3573 | " Country City Weight Height BMI Birth Year Current Year\n", 3574 | "0 Finland Helsinki 74.0 1.73 24.7 1769 2020.0\n", 3575 | "1 UK London 78.0 1.75 25.5 1985 2020.0\n", 3576 | "2 Sweden Stockholm 69.0 1.69 24.2 1990 2020.0\n", 3577 | "3 Finland Espoo 71.0 1.73 23.7 1983 2020.0\n", 3578 | "4 Poland Warsaw 102.0 1.95 26.8 1985 2020.0\n", 3579 | "5 NaN NaN NaN NaN NaN NaN NaN" 3580 | ] 3581 | }, 3582 | "execution_count": 469, 3583 | "metadata": {}, 3584 | "output_type": "execute_result" 3585 | } 3586 | ], 3587 | "source": [ 3588 | "df" 3589 | ] 3590 | }, 3591 | { 3592 | "cell_type": "markdown", 3593 | "metadata": {}, 3594 | "source": [ 3595 | "## Checking data types of Column values" 3596 | ] 3597 | }, 3598 | { 3599 | "cell_type": "code", 3600 | "execution_count": 470, 3601 | "metadata": {}, 3602 | "outputs": [ 3603 | { 3604 | "data": { 3605 | "text/plain": [ 3606 | "dtype('float64')" 3607 | ] 3608 | }, 3609 | "execution_count": 470, 3610 | "metadata": {}, 3611 | "output_type": "execute_result" 3612 | } 3613 | ], 3614 | "source": [ 3615 | "df.Weight.dtype" 3616 | ] 3617 | }, 3618 | { 3619 | "cell_type": "code", 3620 | "execution_count": 471, 3621 | "metadata": {}, 3622 | "outputs": [ 3623 | { 3624 | "data": { 3625 | "text/plain": [ 3626 | "dtype('O')" 3627 | ] 3628 | }, 3629 | "execution_count": 471, 3630 | "metadata": {}, 3631 | "output_type": "execute_result" 3632 | } 3633 | ], 3634 | "source": [ 3635 | "df['Birth Year'].dtype # it gives string object , we should change this to " 3636 | ] 3637 | }, 3638 | { 3639 | "cell_type": "code", 3640 | "execution_count": 472, 3641 | "metadata": {}, 3642 | "outputs": [ 3643 | { 3644 | "name": "stdout", 3645 | "output_type": "stream", 3646 | "text": [ 3647 | "float64\n" 3648 | ] 3649 | } 3650 | ], 3651 | "source": [ 3652 | "# dropping the NaN type first\n", 3653 | "df['Birth Year'] = df.drop([5, 5], axis = 0)['Birth Year'].astype('int')\n", 3654 | "print(df['Birth Year'].dtype) # let's check the data type now" 3655 | ] 3656 | }, 3657 | { 3658 | "cell_type": "markdown", 3659 | "metadata": {}, 3660 | "source": [ 3661 | "Now same for the current year:" 3662 | ] 3663 | }, 3664 | { 3665 | "cell_type": "code", 3666 | "execution_count": 473, 3667 | "metadata": {}, 3668 | "outputs": [ 3669 | { 3670 | "data": { 3671 | "text/plain": [ 3672 | "dtype('float64')" 3673 | ] 3674 | }, 3675 | "execution_count": 473, 3676 | "metadata": {}, 3677 | "output_type": "execute_result" 3678 | } 3679 | ], 3680 | "source": [ 3681 | "df['Current Year'] = df.drop([5, 5], axis = 0)['Current Year'].astype('int')\n", 3682 | "df['Current Year'].dtype" 3683 | ] 3684 | }, 3685 | { 3686 | "cell_type": "markdown", 3687 | "metadata": {}, 3688 | "source": [ 3689 | "Now, the column values of birth year and current year are integers. We can calculate the age." 3690 | ] 3691 | }, 3692 | { 3693 | "cell_type": "code", 3694 | "execution_count": 474, 3695 | "metadata": {}, 3696 | "outputs": [ 3697 | { 3698 | "data": { 3699 | "text/plain": [ 3700 | "0 251.0\n", 3701 | "1 35.0\n", 3702 | "2 30.0\n", 3703 | "3 37.0\n", 3704 | "4 35.0\n", 3705 | "5 NaN\n", 3706 | "dtype: float64" 3707 | ] 3708 | }, 3709 | "execution_count": 474, 3710 | "metadata": {}, 3711 | "output_type": "execute_result" 3712 | } 3713 | ], 3714 | "source": [ 3715 | "ages = df['Current Year'] - df['Birth Year']\n", 3716 | "ages" 3717 | ] 3718 | }, 3719 | { 3720 | "cell_type": "code", 3721 | "execution_count": 475, 3722 | "metadata": {}, 3723 | "outputs": [ 3724 | { 3725 | "data": { 3726 | "text/html": [ 3727 | "
\n", 3728 | "\n", 3741 | "\n", 3742 | " \n", 3743 | " \n", 3744 | " \n", 3745 | " \n", 3746 | " \n", 3747 | " \n", 3748 | " \n", 3749 | " \n", 3750 | " \n", 3751 | " \n", 3752 | " \n", 3753 | " \n", 3754 | " \n", 3755 | " \n", 3756 | " \n", 3757 | " \n", 3758 | " \n", 3759 | " \n", 3760 | " \n", 3761 | " \n", 3762 | " \n", 3763 | " \n", 3764 | " \n", 3765 | " \n", 3766 | " \n", 3767 | " \n", 3768 | " \n", 3769 | " \n", 3770 | " \n", 3771 | " \n", 3772 | " \n", 3773 | " \n", 3774 | " \n", 3775 | " \n", 3776 | " \n", 3777 | " \n", 3778 | " \n", 3779 | " \n", 3780 | " \n", 3781 | " \n", 3782 | " \n", 3783 | " \n", 3784 | " \n", 3785 | " \n", 3786 | " \n", 3787 | " \n", 3788 | " \n", 3789 | " \n", 3790 | " \n", 3791 | " \n", 3792 | " \n", 3793 | " \n", 3794 | " \n", 3795 | " \n", 3796 | " \n", 3797 | " \n", 3798 | " \n", 3799 | " \n", 3800 | " \n", 3801 | " \n", 3802 | " \n", 3803 | " \n", 3804 | " \n", 3805 | " \n", 3806 | " \n", 3807 | " \n", 3808 | " \n", 3809 | " \n", 3810 | " \n", 3811 | " \n", 3812 | " \n", 3813 | " \n", 3814 | " \n", 3815 | " \n", 3816 | "
CountryCityWeightHeightBMIBirth YearCurrent Year
0FinlandHelsinki74.01.7324.71769.02020.0
1UKLondon78.01.7525.51985.02020.0
2SwedenStockholm69.01.6924.21990.02020.0
3FinlandEspoo71.01.7323.71983.02020.0
4PolandWarsaw102.01.9526.81985.02020.0
5NaNNaNNaNNaNNaNNaNNaN
\n", 3817 | "
" 3818 | ], 3819 | "text/plain": [ 3820 | " Country City Weight Height BMI Birth Year Current Year\n", 3821 | "0 Finland Helsinki 74.0 1.73 24.7 1769.0 2020.0\n", 3822 | "1 UK London 78.0 1.75 25.5 1985.0 2020.0\n", 3823 | "2 Sweden Stockholm 69.0 1.69 24.2 1990.0 2020.0\n", 3824 | "3 Finland Espoo 71.0 1.73 23.7 1983.0 2020.0\n", 3825 | "4 Poland Warsaw 102.0 1.95 26.8 1985.0 2020.0\n", 3826 | "5 NaN NaN NaN NaN NaN NaN NaN" 3827 | ] 3828 | }, 3829 | "execution_count": 475, 3830 | "metadata": {}, 3831 | "output_type": "execute_result" 3832 | } 3833 | ], 3834 | "source": [ 3835 | "df" 3836 | ] 3837 | }, 3838 | { 3839 | "cell_type": "code", 3840 | "execution_count": 476, 3841 | "metadata": {}, 3842 | "outputs": [], 3843 | "source": [ 3844 | "df['Ages'] = ages" 3845 | ] 3846 | }, 3847 | { 3848 | "cell_type": "code", 3849 | "execution_count": 477, 3850 | "metadata": {}, 3851 | "outputs": [ 3852 | { 3853 | "data": { 3854 | "text/html": [ 3855 | "
\n", 3856 | "\n", 3869 | "\n", 3870 | " \n", 3871 | " \n", 3872 | " \n", 3873 | " \n", 3874 | " \n", 3875 | " \n", 3876 | " \n", 3877 | " \n", 3878 | " \n", 3879 | " \n", 3880 | " \n", 3881 | " \n", 3882 | " \n", 3883 | " \n", 3884 | " \n", 3885 | " \n", 3886 | " \n", 3887 | " \n", 3888 | " \n", 3889 | " \n", 3890 | " \n", 3891 | " \n", 3892 | " \n", 3893 | " \n", 3894 | " \n", 3895 | " \n", 3896 | " \n", 3897 | " \n", 3898 | " \n", 3899 | " \n", 3900 | " \n", 3901 | " \n", 3902 | " \n", 3903 | " \n", 3904 | " \n", 3905 | " \n", 3906 | " \n", 3907 | " \n", 3908 | " \n", 3909 | " \n", 3910 | " \n", 3911 | " \n", 3912 | " \n", 3913 | " \n", 3914 | " \n", 3915 | " \n", 3916 | " \n", 3917 | " \n", 3918 | " \n", 3919 | " \n", 3920 | " \n", 3921 | " \n", 3922 | " \n", 3923 | " \n", 3924 | " \n", 3925 | " \n", 3926 | " \n", 3927 | " \n", 3928 | " \n", 3929 | " \n", 3930 | " \n", 3931 | " \n", 3932 | " \n", 3933 | " \n", 3934 | " \n", 3935 | " \n", 3936 | " \n", 3937 | " \n", 3938 | " \n", 3939 | " \n", 3940 | " \n", 3941 | " \n", 3942 | " \n", 3943 | " \n", 3944 | " \n", 3945 | " \n", 3946 | " \n", 3947 | " \n", 3948 | " \n", 3949 | " \n", 3950 | " \n", 3951 | "
CountryCityWeightHeightBMIBirth YearCurrent YearAges
0FinlandHelsinki74.01.7324.71769.02020.0251.0
1UKLondon78.01.7525.51985.02020.035.0
2SwedenStockholm69.01.6924.21990.02020.030.0
3FinlandEspoo71.01.7323.71983.02020.037.0
4PolandWarsaw102.01.9526.81985.02020.035.0
5NaNNaNNaNNaNNaNNaNNaNNaN
\n", 3952 | "
" 3953 | ], 3954 | "text/plain": [ 3955 | " Country City Weight Height BMI Birth Year Current Year Ages\n", 3956 | "0 Finland Helsinki 74.0 1.73 24.7 1769.0 2020.0 251.0\n", 3957 | "1 UK London 78.0 1.75 25.5 1985.0 2020.0 35.0\n", 3958 | "2 Sweden Stockholm 69.0 1.69 24.2 1990.0 2020.0 30.0\n", 3959 | "3 Finland Espoo 71.0 1.73 23.7 1983.0 2020.0 37.0\n", 3960 | "4 Poland Warsaw 102.0 1.95 26.8 1985.0 2020.0 35.0\n", 3961 | "5 NaN NaN NaN NaN NaN NaN NaN NaN" 3962 | ] 3963 | }, 3964 | "execution_count": 477, 3965 | "metadata": {}, 3966 | "output_type": "execute_result" 3967 | } 3968 | ], 3969 | "source": [ 3970 | "df" 3971 | ] 3972 | }, 3973 | { 3974 | "cell_type": "markdown", 3975 | "metadata": {}, 3976 | "source": [ 3977 | "The person in the first row lived so far for 251 years. It is unlikely for someone to live so long. Either it is a typo or the data is cooked. So lets fill that data with average of the columns without including outlier. \n", 3978 | "\n", 3979 | "mean = (35 + 30) / 2" 3980 | ] 3981 | }, 3982 | { 3983 | "cell_type": "code", 3984 | "execution_count": 478, 3985 | "metadata": {}, 3986 | "outputs": [ 3987 | { 3988 | "name": "stdout", 3989 | "output_type": "stream", 3990 | "text": [ 3991 | "Mean: 32.5\n" 3992 | ] 3993 | } 3994 | ], 3995 | "source": [ 3996 | "mean = (35 + 30) / 2\n", 3997 | "print('Mean: ',mean) #it is good to add some description to the output, so we know what is what" 3998 | ] 3999 | }, 4000 | { 4001 | "cell_type": "code", 4002 | "execution_count": 479, 4003 | "metadata": {}, 4004 | "outputs": [ 4005 | { 4006 | "data": { 4007 | "text/html": [ 4008 | "
\n", 4009 | "\n", 4022 | "\n", 4023 | " \n", 4024 | " \n", 4025 | " \n", 4026 | " \n", 4027 | " \n", 4028 | " \n", 4029 | " \n", 4030 | " \n", 4031 | " \n", 4032 | " \n", 4033 | " \n", 4034 | " \n", 4035 | " \n", 4036 | " \n", 4037 | " \n", 4038 | " \n", 4039 | " \n", 4040 | " \n", 4041 | " \n", 4042 | " \n", 4043 | " \n", 4044 | " \n", 4045 | " \n", 4046 | " \n", 4047 | " \n", 4048 | " \n", 4049 | " \n", 4050 | " \n", 4051 | " \n", 4052 | " \n", 4053 | " \n", 4054 | " \n", 4055 | " \n", 4056 | " \n", 4057 | " \n", 4058 | " \n", 4059 | " \n", 4060 | " \n", 4061 | " \n", 4062 | " \n", 4063 | " \n", 4064 | " \n", 4065 | " \n", 4066 | " \n", 4067 | " \n", 4068 | " \n", 4069 | " \n", 4070 | " \n", 4071 | " \n", 4072 | " \n", 4073 | " \n", 4074 | " \n", 4075 | " \n", 4076 | " \n", 4077 | " \n", 4078 | " \n", 4079 | " \n", 4080 | " \n", 4081 | " \n", 4082 | " \n", 4083 | " \n", 4084 | " \n", 4085 | " \n", 4086 | " \n", 4087 | " \n", 4088 | " \n", 4089 | " \n", 4090 | " \n", 4091 | " \n", 4092 | " \n", 4093 | " \n", 4094 | " \n", 4095 | " \n", 4096 | " \n", 4097 | " \n", 4098 | " \n", 4099 | " \n", 4100 | " \n", 4101 | " \n", 4102 | " \n", 4103 | " \n", 4104 | "
CountryCityWeightHeightBMIBirth YearCurrent YearAges
0FinlandHelsinki74.01.7324.71769.02020.0251.0
1UKLondon78.01.7525.51985.02020.035.0
2SwedenStockholm69.01.6924.21990.02020.030.0
3FinlandEspoo71.01.7323.71983.02020.037.0
4PolandWarsaw102.01.9526.81985.02020.035.0
5NaNNaNNaNNaNNaNNaNNaNNaN
\n", 4105 | "
" 4106 | ], 4107 | "text/plain": [ 4108 | " Country City Weight Height BMI Birth Year Current Year Ages\n", 4109 | "0 Finland Helsinki 74.0 1.73 24.7 1769.0 2020.0 251.0\n", 4110 | "1 UK London 78.0 1.75 25.5 1985.0 2020.0 35.0\n", 4111 | "2 Sweden Stockholm 69.0 1.69 24.2 1990.0 2020.0 30.0\n", 4112 | "3 Finland Espoo 71.0 1.73 23.7 1983.0 2020.0 37.0\n", 4113 | "4 Poland Warsaw 102.0 1.95 26.8 1985.0 2020.0 35.0\n", 4114 | "5 NaN NaN NaN NaN NaN NaN NaN NaN" 4115 | ] 4116 | }, 4117 | "execution_count": 479, 4118 | "metadata": {}, 4119 | "output_type": "execute_result" 4120 | } 4121 | ], 4122 | "source": [ 4123 | "df" 4124 | ] 4125 | }, 4126 | { 4127 | "cell_type": "markdown", 4128 | "metadata": {}, 4129 | "source": [ 4130 | "We can use the iloc method to impute the value.\n", 4131 | "DataFrame.iloc(row, col)" 4132 | ] 4133 | }, 4134 | { 4135 | "cell_type": "code", 4136 | "execution_count": 480, 4137 | "metadata": {}, 4138 | "outputs": [], 4139 | "source": [ 4140 | "df.iloc[0, 7] = (35 + 30) / 2" 4141 | ] 4142 | }, 4143 | { 4144 | "cell_type": "code", 4145 | "execution_count": 481, 4146 | "metadata": {}, 4147 | "outputs": [ 4148 | { 4149 | "data": { 4150 | "text/html": [ 4151 | "
\n", 4152 | "\n", 4165 | "\n", 4166 | " \n", 4167 | " \n", 4168 | " \n", 4169 | " \n", 4170 | " \n", 4171 | " \n", 4172 | " \n", 4173 | " \n", 4174 | " \n", 4175 | " \n", 4176 | " \n", 4177 | " \n", 4178 | " \n", 4179 | " \n", 4180 | " \n", 4181 | " \n", 4182 | " \n", 4183 | " \n", 4184 | " \n", 4185 | " \n", 4186 | " \n", 4187 | " \n", 4188 | " \n", 4189 | " \n", 4190 | " \n", 4191 | " \n", 4192 | " \n", 4193 | " \n", 4194 | " \n", 4195 | " \n", 4196 | " \n", 4197 | " \n", 4198 | " \n", 4199 | " \n", 4200 | " \n", 4201 | " \n", 4202 | " \n", 4203 | " \n", 4204 | " \n", 4205 | " \n", 4206 | " \n", 4207 | " \n", 4208 | " \n", 4209 | " \n", 4210 | " \n", 4211 | " \n", 4212 | " \n", 4213 | " \n", 4214 | " \n", 4215 | " \n", 4216 | " \n", 4217 | " \n", 4218 | " \n", 4219 | " \n", 4220 | " \n", 4221 | " \n", 4222 | " \n", 4223 | " \n", 4224 | " \n", 4225 | " \n", 4226 | " \n", 4227 | " \n", 4228 | " \n", 4229 | " \n", 4230 | " \n", 4231 | " \n", 4232 | " \n", 4233 | " \n", 4234 | " \n", 4235 | " \n", 4236 | " \n", 4237 | " \n", 4238 | " \n", 4239 | " \n", 4240 | " \n", 4241 | " \n", 4242 | " \n", 4243 | " \n", 4244 | " \n", 4245 | " \n", 4246 | " \n", 4247 | "
CountryCityWeightHeightBMIBirth YearCurrent YearAges
0FinlandHelsinki74.01.7324.71769.02020.032.5
1UKLondon78.01.7525.51985.02020.035.0
2SwedenStockholm69.01.6924.21990.02020.030.0
3FinlandEspoo71.01.7323.71983.02020.037.0
4PolandWarsaw102.01.9526.81985.02020.035.0
5NaNNaNNaNNaNNaNNaNNaNNaN
\n", 4248 | "
" 4249 | ], 4250 | "text/plain": [ 4251 | " Country City Weight Height BMI Birth Year Current Year Ages\n", 4252 | "0 Finland Helsinki 74.0 1.73 24.7 1769.0 2020.0 32.5\n", 4253 | "1 UK London 78.0 1.75 25.5 1985.0 2020.0 35.0\n", 4254 | "2 Sweden Stockholm 69.0 1.69 24.2 1990.0 2020.0 30.0\n", 4255 | "3 Finland Espoo 71.0 1.73 23.7 1983.0 2020.0 37.0\n", 4256 | "4 Poland Warsaw 102.0 1.95 26.8 1985.0 2020.0 35.0\n", 4257 | "5 NaN NaN NaN NaN NaN NaN NaN NaN" 4258 | ] 4259 | }, 4260 | "execution_count": 481, 4261 | "metadata": {}, 4262 | "output_type": "execute_result" 4263 | } 4264 | ], 4265 | "source": [ 4266 | "df" 4267 | ] 4268 | }, 4269 | { 4270 | "cell_type": "markdown", 4271 | "metadata": {}, 4272 | "source": [ 4273 | "### Boolean Indexing" 4274 | ] 4275 | }, 4276 | { 4277 | "cell_type": "code", 4278 | "execution_count": 482, 4279 | "metadata": {}, 4280 | "outputs": [ 4281 | { 4282 | "data": { 4283 | "text/html": [ 4284 | "
\n", 4285 | "\n", 4298 | "\n", 4299 | " \n", 4300 | " \n", 4301 | " \n", 4302 | " \n", 4303 | " \n", 4304 | " \n", 4305 | " \n", 4306 | " \n", 4307 | " \n", 4308 | " \n", 4309 | " \n", 4310 | " \n", 4311 | " \n", 4312 | " \n", 4313 | " \n", 4314 | " \n", 4315 | " \n", 4316 | " \n", 4317 | " \n", 4318 | " \n", 4319 | " \n", 4320 | " \n", 4321 | " \n", 4322 | " \n", 4323 | " \n", 4324 | " \n", 4325 | "
CountryCityWeightHeightBMIBirth YearCurrent YearAges
0FinlandHelsinki74.01.7324.71769.02020.032.5
\n", 4326 | "
" 4327 | ], 4328 | "text/plain": [ 4329 | " Country City Weight Height BMI Birth Year Current Year Ages\n", 4330 | "0 Finland Helsinki 74.0 1.73 24.7 1769.0 2020.0 32.5" 4331 | ] 4332 | }, 4333 | "execution_count": 482, 4334 | "metadata": {}, 4335 | "output_type": "execute_result" 4336 | } 4337 | ], 4338 | "source": [ 4339 | "df[df['Birth Year'] < 1900]" 4340 | ] 4341 | }, 4342 | { 4343 | "cell_type": "markdown", 4344 | "metadata": {}, 4345 | "source": [ 4346 | "## Exercises\n", 4347 | "\n", 4348 | "1. Read the hacker_news.csv file from data directory \n", 4349 | "1. Get the first five rows\n", 4350 | "1. Get the last five rows\n", 4351 | "1. Get the title column as pandas series\n", 4352 | "1. Count the number of rows and columns\n", 4353 | " - Filter the titles which contain python\n", 4354 | " - Filter the titles which contain JavaScript\n", 4355 | " - Explore the data and make sense of it" 4356 | ] 4357 | }, 4358 | { 4359 | "cell_type": "code", 4360 | "execution_count": null, 4361 | "metadata": {}, 4362 | "outputs": [], 4363 | "source": [] 4364 | }, 4365 | { 4366 | "cell_type": "code", 4367 | "execution_count": null, 4368 | "metadata": {}, 4369 | "outputs": [], 4370 | "source": [] 4371 | }, 4372 | { 4373 | "cell_type": "code", 4374 | "execution_count": null, 4375 | "metadata": {}, 4376 | "outputs": [], 4377 | "source": [] 4378 | } 4379 | ], 4380 | "metadata": { 4381 | "kernelspec": { 4382 | "display_name": "Python 3", 4383 | "language": "python", 4384 | "name": "python3" 4385 | }, 4386 | "language_info": { 4387 | "codemirror_mode": { 4388 | "name": "ipython", 4389 | "version": 3 4390 | }, 4391 | "file_extension": ".py", 4392 | "mimetype": "text/x-python", 4393 | "name": "python", 4394 | "nbconvert_exporter": "python", 4395 | "pygments_lexer": "ipython3", 4396 | "version": "3.8.5" 4397 | } 4398 | }, 4399 | "nbformat": 4, 4400 | "nbformat_minor": 4 4401 | } 4402 | -------------------------------------------------------------------------------- /datasets/countries-data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Afghanistan", 4 | "capital": "Kabul", 5 | "languages": [ 6 | "Pashto", 7 | "Uzbek", 8 | "Turkmen" 9 | ], 10 | "population": 27657145, 11 | "flag": "https://restcountries.eu/data/afg.svg", 12 | "currency": "Afghan afghani" 13 | }, 14 | { 15 | "name": "Åland Islands", 16 | "capital": "Mariehamn", 17 | "languages": [ 18 | "Swedish" 19 | ], 20 | "population": 28875, 21 | "flag": "https://restcountries.eu/data/ala.svg", 22 | "currency": "Euro" 23 | }, 24 | { 25 | "name": "Albania", 26 | "capital": "Tirana", 27 | "languages": [ 28 | "Albanian" 29 | ], 30 | "population": 2886026, 31 | "flag": "https://restcountries.eu/data/alb.svg", 32 | "currency": "Albanian lek" 33 | }, 34 | { 35 | "name": "Algeria", 36 | "capital": "Algiers", 37 | "languages": [ 38 | "Arabic" 39 | ], 40 | "population": 40400000, 41 | "flag": "https://restcountries.eu/data/dza.svg", 42 | "currency": "Algerian dinar" 43 | }, 44 | { 45 | "name": "American Samoa", 46 | "capital": "Pago Pago", 47 | "languages": [ 48 | "English", 49 | "Samoan" 50 | ], 51 | "population": 57100, 52 | "flag": "https://restcountries.eu/data/asm.svg", 53 | "currency": "United State Dollar" 54 | }, 55 | { 56 | "name": "Andorra", 57 | "capital": "Andorra la Vella", 58 | "languages": [ 59 | "Catalan" 60 | ], 61 | "population": 78014, 62 | "flag": "https://restcountries.eu/data/and.svg", 63 | "currency": "Euro" 64 | }, 65 | { 66 | "name": "Angola", 67 | "capital": "Luanda", 68 | "languages": [ 69 | "Portuguese" 70 | ], 71 | "population": 25868000, 72 | "flag": "https://restcountries.eu/data/ago.svg", 73 | "currency": "Angolan kwanza" 74 | }, 75 | { 76 | "name": "Anguilla", 77 | "capital": "The Valley", 78 | "languages": [ 79 | "English" 80 | ], 81 | "population": 13452, 82 | "flag": "https://restcountries.eu/data/aia.svg", 83 | "currency": "East Caribbean dollar" 84 | }, 85 | { 86 | "name": "Antarctica", 87 | "capital": "", 88 | "languages": [ 89 | "English", 90 | "Russian" 91 | ], 92 | "population": 1000, 93 | "flag": "https://restcountries.eu/data/ata.svg", 94 | "currency": "Australian dollar" 95 | }, 96 | { 97 | "name": "Antigua and Barbuda", 98 | "capital": "Saint John's", 99 | "languages": [ 100 | "English" 101 | ], 102 | "population": 86295, 103 | "flag": "https://restcountries.eu/data/atg.svg", 104 | "currency": "East Caribbean dollar" 105 | }, 106 | { 107 | "name": "Argentina", 108 | "capital": "Buenos Aires", 109 | "languages": [ 110 | "Spanish", 111 | "Guaraní" 112 | ], 113 | "population": 43590400, 114 | "flag": "https://restcountries.eu/data/arg.svg", 115 | "currency": "Argentine peso" 116 | }, 117 | { 118 | "name": "Armenia", 119 | "capital": "Yerevan", 120 | "languages": [ 121 | "Armenian", 122 | "Russian" 123 | ], 124 | "population": 2994400, 125 | "flag": "https://restcountries.eu/data/arm.svg", 126 | "currency": "Armenian dram" 127 | }, 128 | { 129 | "name": "Aruba", 130 | "capital": "Oranjestad", 131 | "languages": [ 132 | "Dutch", 133 | "(Eastern) Punjabi" 134 | ], 135 | "population": 107394, 136 | "flag": "https://restcountries.eu/data/abw.svg", 137 | "currency": "Aruban florin" 138 | }, 139 | { 140 | "name": "Australia", 141 | "capital": "Canberra", 142 | "languages": [ 143 | "English" 144 | ], 145 | "population": 24117360, 146 | "flag": "https://restcountries.eu/data/aus.svg", 147 | "currency": "Australian dollar" 148 | }, 149 | { 150 | "name": "Austria", 151 | "capital": "Vienna", 152 | "languages": [ 153 | "German" 154 | ], 155 | "population": 8725931, 156 | "flag": "https://restcountries.eu/data/aut.svg", 157 | "currency": "Euro" 158 | }, 159 | { 160 | "name": "Azerbaijan", 161 | "capital": "Baku", 162 | "languages": [ 163 | "Azerbaijani" 164 | ], 165 | "population": 9730500, 166 | "flag": "https://restcountries.eu/data/aze.svg", 167 | "currency": "Azerbaijani manat" 168 | }, 169 | { 170 | "name": "Bahamas", 171 | "capital": "Nassau", 172 | "languages": [ 173 | "English" 174 | ], 175 | "population": 378040, 176 | "flag": "https://restcountries.eu/data/bhs.svg", 177 | "currency": "Bahamian dollar" 178 | }, 179 | { 180 | "name": "Bahrain", 181 | "capital": "Manama", 182 | "languages": [ 183 | "Arabic" 184 | ], 185 | "population": 1404900, 186 | "flag": "https://restcountries.eu/data/bhr.svg", 187 | "currency": "Bahraini dinar" 188 | }, 189 | { 190 | "name": "Bangladesh", 191 | "capital": "Dhaka", 192 | "languages": [ 193 | "Bengali" 194 | ], 195 | "population": 161006790, 196 | "flag": "https://restcountries.eu/data/bgd.svg", 197 | "currency": "Bangladeshi taka" 198 | }, 199 | { 200 | "name": "Barbados", 201 | "capital": "Bridgetown", 202 | "languages": [ 203 | "English" 204 | ], 205 | "population": 285000, 206 | "flag": "https://restcountries.eu/data/brb.svg", 207 | "currency": "Barbadian dollar" 208 | }, 209 | { 210 | "name": "Belarus", 211 | "capital": "Minsk", 212 | "languages": [ 213 | "Belarusian", 214 | "Russian" 215 | ], 216 | "population": 9498700, 217 | "flag": "https://restcountries.eu/data/blr.svg", 218 | "currency": "New Belarusian ruble" 219 | }, 220 | { 221 | "name": "Belgium", 222 | "capital": "Brussels", 223 | "languages": [ 224 | "Dutch", 225 | "French", 226 | "German" 227 | ], 228 | "population": 11319511, 229 | "flag": "https://restcountries.eu/data/bel.svg", 230 | "currency": "Euro" 231 | }, 232 | { 233 | "name": "Belize", 234 | "capital": "Belmopan", 235 | "languages": [ 236 | "English", 237 | "Spanish" 238 | ], 239 | "population": 370300, 240 | "flag": "https://restcountries.eu/data/blz.svg", 241 | "currency": "Belize dollar" 242 | }, 243 | { 244 | "name": "Benin", 245 | "capital": "Porto-Novo", 246 | "languages": [ 247 | "French" 248 | ], 249 | "population": 10653654, 250 | "flag": "https://restcountries.eu/data/ben.svg", 251 | "currency": "West African CFA franc" 252 | }, 253 | { 254 | "name": "Bermuda", 255 | "capital": "Hamilton", 256 | "languages": [ 257 | "English" 258 | ], 259 | "population": 61954, 260 | "flag": "https://restcountries.eu/data/bmu.svg", 261 | "currency": "Bermudian dollar" 262 | }, 263 | { 264 | "name": "Bhutan", 265 | "capital": "Thimphu", 266 | "languages": [ 267 | "Dzongkha" 268 | ], 269 | "population": 775620, 270 | "flag": "https://restcountries.eu/data/btn.svg", 271 | "currency": "Bhutanese ngultrum" 272 | }, 273 | { 274 | "name": "Bolivia (Plurinational State of)", 275 | "capital": "Sucre", 276 | "languages": [ 277 | "Spanish", 278 | "Aymara", 279 | "Quechua" 280 | ], 281 | "population": 10985059, 282 | "flag": "https://restcountries.eu/data/bol.svg", 283 | "currency": "Bolivian boliviano" 284 | }, 285 | { 286 | "name": "Bonaire, Sint Eustatius and Saba", 287 | "capital": "Kralendijk", 288 | "languages": [ 289 | "Dutch" 290 | ], 291 | "population": 17408, 292 | "flag": "https://restcountries.eu/data/bes.svg", 293 | "currency": "United States dollar" 294 | }, 295 | { 296 | "name": "Bosnia and Herzegovina", 297 | "capital": "Sarajevo", 298 | "languages": [ 299 | "Bosnian", 300 | "Croatian", 301 | "Serbian" 302 | ], 303 | "population": 3531159, 304 | "flag": "https://restcountries.eu/data/bih.svg", 305 | "currency": "Bosnia and Herzegovina convertible mark" 306 | }, 307 | { 308 | "name": "Botswana", 309 | "capital": "Gaborone", 310 | "languages": [ 311 | "English", 312 | "Tswana" 313 | ], 314 | "population": 2141206, 315 | "flag": "https://restcountries.eu/data/bwa.svg", 316 | "currency": "Botswana pula" 317 | }, 318 | { 319 | "name": "Bouvet Island", 320 | "capital": "", 321 | "languages": [ 322 | "Norwegian", 323 | "Norwegian Bokmål", 324 | "Norwegian Nynorsk" 325 | ], 326 | "population": 0, 327 | "flag": "https://restcountries.eu/data/bvt.svg", 328 | "currency": "Norwegian krone" 329 | }, 330 | { 331 | "name": "Brazil", 332 | "capital": "Brasília", 333 | "languages": [ 334 | "Portuguese" 335 | ], 336 | "population": 206135893, 337 | "flag": "https://restcountries.eu/data/bra.svg", 338 | "currency": "Brazilian real" 339 | }, 340 | { 341 | "name": "British Indian Ocean Territory", 342 | "capital": "Diego Garcia", 343 | "languages": [ 344 | "English" 345 | ], 346 | "population": 3000, 347 | "flag": "https://restcountries.eu/data/iot.svg", 348 | "currency": "United States dollar" 349 | }, 350 | { 351 | "name": "United States Minor Outlying Islands", 352 | "capital": "", 353 | "languages": [ 354 | "English" 355 | ], 356 | "population": 300, 357 | "flag": "https://restcountries.eu/data/umi.svg", 358 | "currency": "United States Dollar" 359 | }, 360 | { 361 | "name": "Virgin Islands (British)", 362 | "capital": "Road Town", 363 | "languages": [ 364 | "English" 365 | ], 366 | "population": 28514, 367 | "flag": "https://restcountries.eu/data/vgb.svg", 368 | "currency": "[D]" 369 | }, 370 | { 371 | "name": "Virgin Islands (U.S.)", 372 | "capital": "Charlotte Amalie", 373 | "languages": [ 374 | "English" 375 | ], 376 | "population": 114743, 377 | "flag": "https://restcountries.eu/data/vir.svg", 378 | "currency": "United States dollar" 379 | }, 380 | { 381 | "name": "Brunei Darussalam", 382 | "capital": "Bandar Seri Begawan", 383 | "languages": [ 384 | "Malay" 385 | ], 386 | "population": 411900, 387 | "flag": "https://restcountries.eu/data/brn.svg", 388 | "currency": "Brunei dollar" 389 | }, 390 | { 391 | "name": "Bulgaria", 392 | "capital": "Sofia", 393 | "languages": [ 394 | "Bulgarian" 395 | ], 396 | "population": 7153784, 397 | "flag": "https://restcountries.eu/data/bgr.svg", 398 | "currency": "Bulgarian lev" 399 | }, 400 | { 401 | "name": "Burkina Faso", 402 | "capital": "Ouagadougou", 403 | "languages": [ 404 | "French", 405 | "Fula" 406 | ], 407 | "population": 19034397, 408 | "flag": "https://restcountries.eu/data/bfa.svg", 409 | "currency": "West African CFA franc" 410 | }, 411 | { 412 | "name": "Burundi", 413 | "capital": "Bujumbura", 414 | "languages": [ 415 | "French", 416 | "Kirundi" 417 | ], 418 | "population": 10114505, 419 | "flag": "https://restcountries.eu/data/bdi.svg", 420 | "currency": "Burundian franc" 421 | }, 422 | { 423 | "name": "Cambodia", 424 | "capital": "Phnom Penh", 425 | "languages": [ 426 | "Khmer" 427 | ], 428 | "population": 15626444, 429 | "flag": "https://restcountries.eu/data/khm.svg", 430 | "currency": "Cambodian riel" 431 | }, 432 | { 433 | "name": "Cameroon", 434 | "capital": "Yaoundé", 435 | "languages": [ 436 | "English", 437 | "French" 438 | ], 439 | "population": 22709892, 440 | "flag": "https://restcountries.eu/data/cmr.svg", 441 | "currency": "Central African CFA franc" 442 | }, 443 | { 444 | "name": "Canada", 445 | "capital": "Ottawa", 446 | "languages": [ 447 | "English", 448 | "French" 449 | ], 450 | "population": 36155487, 451 | "flag": "https://restcountries.eu/data/can.svg", 452 | "currency": "Canadian dollar" 453 | }, 454 | { 455 | "name": "Cabo Verde", 456 | "capital": "Praia", 457 | "languages": [ 458 | "Portuguese" 459 | ], 460 | "population": 531239, 461 | "flag": "https://restcountries.eu/data/cpv.svg", 462 | "currency": "Cape Verdean escudo" 463 | }, 464 | { 465 | "name": "Cayman Islands", 466 | "capital": "George Town", 467 | "languages": [ 468 | "English" 469 | ], 470 | "population": 58238, 471 | "flag": "https://restcountries.eu/data/cym.svg", 472 | "currency": "Cayman Islands dollar" 473 | }, 474 | { 475 | "name": "Central African Republic", 476 | "capital": "Bangui", 477 | "languages": [ 478 | "French", 479 | "Sango" 480 | ], 481 | "population": 4998000, 482 | "flag": "https://restcountries.eu/data/caf.svg", 483 | "currency": "Central African CFA franc" 484 | }, 485 | { 486 | "name": "Chad", 487 | "capital": "N'Djamena", 488 | "languages": [ 489 | "French", 490 | "Arabic" 491 | ], 492 | "population": 14497000, 493 | "flag": "https://restcountries.eu/data/tcd.svg", 494 | "currency": "Central African CFA franc" 495 | }, 496 | { 497 | "name": "Chile", 498 | "capital": "Santiago", 499 | "languages": [ 500 | "Spanish" 501 | ], 502 | "population": 18191900, 503 | "flag": "https://restcountries.eu/data/chl.svg", 504 | "currency": "Chilean peso" 505 | }, 506 | { 507 | "name": "China", 508 | "capital": "Beijing", 509 | "languages": [ 510 | "Chinese" 511 | ], 512 | "population": 1377422166, 513 | "flag": "https://restcountries.eu/data/chn.svg", 514 | "currency": "Chinese yuan" 515 | }, 516 | { 517 | "name": "Christmas Island", 518 | "capital": "Flying Fish Cove", 519 | "languages": [ 520 | "English" 521 | ], 522 | "population": 2072, 523 | "flag": "https://restcountries.eu/data/cxr.svg", 524 | "currency": "Australian dollar" 525 | }, 526 | { 527 | "name": "Cocos (Keeling) Islands", 528 | "capital": "West Island", 529 | "languages": [ 530 | "English" 531 | ], 532 | "population": 550, 533 | "flag": "https://restcountries.eu/data/cck.svg", 534 | "currency": "Australian dollar" 535 | }, 536 | { 537 | "name": "Colombia", 538 | "capital": "Bogotá", 539 | "languages": [ 540 | "Spanish" 541 | ], 542 | "population": 48759958, 543 | "flag": "https://restcountries.eu/data/col.svg", 544 | "currency": "Colombian peso" 545 | }, 546 | { 547 | "name": "Comoros", 548 | "capital": "Moroni", 549 | "languages": [ 550 | "Arabic", 551 | "French" 552 | ], 553 | "population": 806153, 554 | "flag": "https://restcountries.eu/data/com.svg", 555 | "currency": "Comorian franc" 556 | }, 557 | { 558 | "name": "Congo", 559 | "capital": "Brazzaville", 560 | "languages": [ 561 | "French", 562 | "Lingala" 563 | ], 564 | "population": 4741000, 565 | "flag": "https://restcountries.eu/data/cog.svg", 566 | "currency": "Central African CFA franc" 567 | }, 568 | { 569 | "name": "Congo (Democratic Republic of the)", 570 | "capital": "Kinshasa", 571 | "languages": [ 572 | "French", 573 | "Lingala", 574 | "Kongo", 575 | "Swahili", 576 | "Luba-Katanga" 577 | ], 578 | "population": 85026000, 579 | "flag": "https://restcountries.eu/data/cod.svg", 580 | "currency": "Congolese franc" 581 | }, 582 | { 583 | "name": "Cook Islands", 584 | "capital": "Avarua", 585 | "languages": [ 586 | "English" 587 | ], 588 | "population": 18100, 589 | "flag": "https://restcountries.eu/data/cok.svg", 590 | "currency": "New Zealand dollar" 591 | }, 592 | { 593 | "name": "Costa Rica", 594 | "capital": "San José", 595 | "languages": [ 596 | "Spanish" 597 | ], 598 | "population": 4890379, 599 | "flag": "https://restcountries.eu/data/cri.svg", 600 | "currency": "Costa Rican colón" 601 | }, 602 | { 603 | "name": "Croatia", 604 | "capital": "Zagreb", 605 | "languages": [ 606 | "Croatian" 607 | ], 608 | "population": 4190669, 609 | "flag": "https://restcountries.eu/data/hrv.svg", 610 | "currency": "Croatian kuna" 611 | }, 612 | { 613 | "name": "Cuba", 614 | "capital": "Havana", 615 | "languages": [ 616 | "Spanish" 617 | ], 618 | "population": 11239004, 619 | "flag": "https://restcountries.eu/data/cub.svg", 620 | "currency": "Cuban convertible peso" 621 | }, 622 | { 623 | "name": "Curaçao", 624 | "capital": "Willemstad", 625 | "languages": [ 626 | "Dutch", 627 | "(Eastern) Punjabi", 628 | "English" 629 | ], 630 | "population": 154843, 631 | "flag": "https://restcountries.eu/data/cuw.svg", 632 | "currency": "Netherlands Antillean guilder" 633 | }, 634 | { 635 | "name": "Cyprus", 636 | "capital": "Nicosia", 637 | "languages": [ 638 | "Greek (modern)", 639 | "Turkish", 640 | "Armenian" 641 | ], 642 | "population": 847000, 643 | "flag": "https://restcountries.eu/data/cyp.svg", 644 | "currency": "Euro" 645 | }, 646 | { 647 | "name": "Czech Republic", 648 | "capital": "Prague", 649 | "languages": [ 650 | "Czech", 651 | "Slovak" 652 | ], 653 | "population": 10558524, 654 | "flag": "https://restcountries.eu/data/cze.svg", 655 | "currency": "Czech koruna" 656 | }, 657 | { 658 | "name": "Denmark", 659 | "capital": "Copenhagen", 660 | "languages": [ 661 | "Danish" 662 | ], 663 | "population": 5717014, 664 | "flag": "https://restcountries.eu/data/dnk.svg", 665 | "currency": "Danish krone" 666 | }, 667 | { 668 | "name": "Djibouti", 669 | "capital": "Djibouti", 670 | "languages": [ 671 | "French", 672 | "Arabic" 673 | ], 674 | "population": 900000, 675 | "flag": "https://restcountries.eu/data/dji.svg", 676 | "currency": "Djiboutian franc" 677 | }, 678 | { 679 | "name": "Dominica", 680 | "capital": "Roseau", 681 | "languages": [ 682 | "English" 683 | ], 684 | "population": 71293, 685 | "flag": "https://restcountries.eu/data/dma.svg", 686 | "currency": "East Caribbean dollar" 687 | }, 688 | { 689 | "name": "Dominican Republic", 690 | "capital": "Santo Domingo", 691 | "languages": [ 692 | "Spanish" 693 | ], 694 | "population": 10075045, 695 | "flag": "https://restcountries.eu/data/dom.svg", 696 | "currency": "Dominican peso" 697 | }, 698 | { 699 | "name": "Ecuador", 700 | "capital": "Quito", 701 | "languages": [ 702 | "Spanish" 703 | ], 704 | "population": 16545799, 705 | "flag": "https://restcountries.eu/data/ecu.svg", 706 | "currency": "United States dollar" 707 | }, 708 | { 709 | "name": "Egypt", 710 | "capital": "Cairo", 711 | "languages": [ 712 | "Arabic" 713 | ], 714 | "population": 91290000, 715 | "flag": "https://restcountries.eu/data/egy.svg", 716 | "currency": "Egyptian pound" 717 | }, 718 | { 719 | "name": "El Salvador", 720 | "capital": "San Salvador", 721 | "languages": [ 722 | "Spanish" 723 | ], 724 | "population": 6520675, 725 | "flag": "https://restcountries.eu/data/slv.svg", 726 | "currency": "United States dollar" 727 | }, 728 | { 729 | "name": "Equatorial Guinea", 730 | "capital": "Malabo", 731 | "languages": [ 732 | "Spanish", 733 | "French" 734 | ], 735 | "population": 1222442, 736 | "flag": "https://restcountries.eu/data/gnq.svg", 737 | "currency": "Central African CFA franc" 738 | }, 739 | { 740 | "name": "Eritrea", 741 | "capital": "Asmara", 742 | "languages": [ 743 | "Tigrinya", 744 | "Arabic", 745 | "English" 746 | ], 747 | "population": 5352000, 748 | "flag": "https://restcountries.eu/data/eri.svg", 749 | "currency": "Eritrean nakfa" 750 | }, 751 | { 752 | "name": "Estonia", 753 | "capital": "Tallinn", 754 | "languages": [ 755 | "Estonian" 756 | ], 757 | "population": 1315944, 758 | "flag": "https://restcountries.eu/data/est.svg", 759 | "currency": "Euro" 760 | }, 761 | { 762 | "name": "Ethiopia", 763 | "capital": "Addis Ababa", 764 | "languages": [ 765 | "Amharic" 766 | ], 767 | "population": 92206005, 768 | "flag": "https://restcountries.eu/data/eth.svg", 769 | "currency": "Ethiopian birr" 770 | }, 771 | { 772 | "name": "Falkland Islands (Malvinas)", 773 | "capital": "Stanley", 774 | "languages": [ 775 | "English" 776 | ], 777 | "population": 2563, 778 | "flag": "https://restcountries.eu/data/flk.svg", 779 | "currency": "Falkland Islands pound" 780 | }, 781 | { 782 | "name": "Faroe Islands", 783 | "capital": "Tórshavn", 784 | "languages": [ 785 | "Faroese" 786 | ], 787 | "population": 49376, 788 | "flag": "https://restcountries.eu/data/fro.svg", 789 | "currency": "Danish krone" 790 | }, 791 | { 792 | "name": "Fiji", 793 | "capital": "Suva", 794 | "languages": [ 795 | "English", 796 | "Fijian", 797 | "Hindi", 798 | "Urdu" 799 | ], 800 | "population": 867000, 801 | "flag": "https://restcountries.eu/data/fji.svg", 802 | "currency": "Fijian dollar" 803 | }, 804 | { 805 | "name": "Finland", 806 | "capital": "Helsinki", 807 | "languages": [ 808 | "Finnish", 809 | "Swedish" 810 | ], 811 | "population": 5491817, 812 | "flag": "https://restcountries.eu/data/fin.svg", 813 | "currency": "Euro" 814 | }, 815 | { 816 | "name": "France", 817 | "capital": "Paris", 818 | "languages": [ 819 | "French" 820 | ], 821 | "population": 66710000, 822 | "flag": "https://restcountries.eu/data/fra.svg", 823 | "currency": "Euro" 824 | }, 825 | { 826 | "name": "French Guiana", 827 | "capital": "Cayenne", 828 | "languages": [ 829 | "French" 830 | ], 831 | "population": 254541, 832 | "flag": "https://restcountries.eu/data/guf.svg", 833 | "currency": "Euro" 834 | }, 835 | { 836 | "name": "French Polynesia", 837 | "capital": "Papeetē", 838 | "languages": [ 839 | "French" 840 | ], 841 | "population": 271800, 842 | "flag": "https://restcountries.eu/data/pyf.svg", 843 | "currency": "CFP franc" 844 | }, 845 | { 846 | "name": "French Southern Territories", 847 | "capital": "Port-aux-Français", 848 | "languages": [ 849 | "French" 850 | ], 851 | "population": 140, 852 | "flag": "https://restcountries.eu/data/atf.svg", 853 | "currency": "Euro" 854 | }, 855 | { 856 | "name": "Gabon", 857 | "capital": "Libreville", 858 | "languages": [ 859 | "French" 860 | ], 861 | "population": 1802278, 862 | "flag": "https://restcountries.eu/data/gab.svg", 863 | "currency": "Central African CFA franc" 864 | }, 865 | { 866 | "name": "Gambia", 867 | "capital": "Banjul", 868 | "languages": [ 869 | "English" 870 | ], 871 | "population": 1882450, 872 | "flag": "https://restcountries.eu/data/gmb.svg", 873 | "currency": "Gambian dalasi" 874 | }, 875 | { 876 | "name": "Georgia", 877 | "capital": "Tbilisi", 878 | "languages": [ 879 | "Georgian" 880 | ], 881 | "population": 3720400, 882 | "flag": "https://restcountries.eu/data/geo.svg", 883 | "currency": "Georgian Lari" 884 | }, 885 | { 886 | "name": "Germany", 887 | "capital": "Berlin", 888 | "languages": [ 889 | "German" 890 | ], 891 | "population": 81770900, 892 | "flag": "https://restcountries.eu/data/deu.svg", 893 | "currency": "Euro" 894 | }, 895 | { 896 | "name": "Ghana", 897 | "capital": "Accra", 898 | "languages": [ 899 | "English" 900 | ], 901 | "population": 27670174, 902 | "flag": "https://restcountries.eu/data/gha.svg", 903 | "currency": "Ghanaian cedi" 904 | }, 905 | { 906 | "name": "Gibraltar", 907 | "capital": "Gibraltar", 908 | "languages": [ 909 | "English" 910 | ], 911 | "population": 33140, 912 | "flag": "https://restcountries.eu/data/gib.svg", 913 | "currency": "Gibraltar pound" 914 | }, 915 | { 916 | "name": "Greece", 917 | "capital": "Athens", 918 | "languages": [ 919 | "Greek (modern)" 920 | ], 921 | "population": 10858018, 922 | "flag": "https://restcountries.eu/data/grc.svg", 923 | "currency": "Euro" 924 | }, 925 | { 926 | "name": "Greenland", 927 | "capital": "Nuuk", 928 | "languages": [ 929 | "Kalaallisut" 930 | ], 931 | "population": 55847, 932 | "flag": "https://restcountries.eu/data/grl.svg", 933 | "currency": "Danish krone" 934 | }, 935 | { 936 | "name": "Grenada", 937 | "capital": "St. George's", 938 | "languages": [ 939 | "English" 940 | ], 941 | "population": 103328, 942 | "flag": "https://restcountries.eu/data/grd.svg", 943 | "currency": "East Caribbean dollar" 944 | }, 945 | { 946 | "name": "Guadeloupe", 947 | "capital": "Basse-Terre", 948 | "languages": [ 949 | "French" 950 | ], 951 | "population": 400132, 952 | "flag": "https://restcountries.eu/data/glp.svg", 953 | "currency": "Euro" 954 | }, 955 | { 956 | "name": "Guam", 957 | "capital": "Hagåtña", 958 | "languages": [ 959 | "English", 960 | "Chamorro", 961 | "Spanish" 962 | ], 963 | "population": 184200, 964 | "flag": "https://restcountries.eu/data/gum.svg", 965 | "currency": "United States dollar" 966 | }, 967 | { 968 | "name": "Guatemala", 969 | "capital": "Guatemala City", 970 | "languages": [ 971 | "Spanish" 972 | ], 973 | "population": 16176133, 974 | "flag": "https://restcountries.eu/data/gtm.svg", 975 | "currency": "Guatemalan quetzal" 976 | }, 977 | { 978 | "name": "Guernsey", 979 | "capital": "St. Peter Port", 980 | "languages": [ 981 | "English", 982 | "French" 983 | ], 984 | "population": 62999, 985 | "flag": "https://restcountries.eu/data/ggy.svg", 986 | "currency": "British pound" 987 | }, 988 | { 989 | "name": "Guinea", 990 | "capital": "Conakry", 991 | "languages": [ 992 | "French", 993 | "Fula" 994 | ], 995 | "population": 12947000, 996 | "flag": "https://restcountries.eu/data/gin.svg", 997 | "currency": "Guinean franc" 998 | }, 999 | { 1000 | "name": "Guinea-Bissau", 1001 | "capital": "Bissau", 1002 | "languages": [ 1003 | "Portuguese" 1004 | ], 1005 | "population": 1547777, 1006 | "flag": "https://restcountries.eu/data/gnb.svg", 1007 | "currency": "West African CFA franc" 1008 | }, 1009 | { 1010 | "name": "Guyana", 1011 | "capital": "Georgetown", 1012 | "languages": [ 1013 | "English" 1014 | ], 1015 | "population": 746900, 1016 | "flag": "https://restcountries.eu/data/guy.svg", 1017 | "currency": "Guyanese dollar" 1018 | }, 1019 | { 1020 | "name": "Haiti", 1021 | "capital": "Port-au-Prince", 1022 | "languages": [ 1023 | "French", 1024 | "Haitian" 1025 | ], 1026 | "population": 11078033, 1027 | "flag": "https://restcountries.eu/data/hti.svg", 1028 | "currency": "Haitian gourde" 1029 | }, 1030 | { 1031 | "name": "Heard Island and McDonald Islands", 1032 | "capital": "", 1033 | "languages": [ 1034 | "English" 1035 | ], 1036 | "population": 0, 1037 | "flag": "https://restcountries.eu/data/hmd.svg", 1038 | "currency": "Australian dollar" 1039 | }, 1040 | { 1041 | "name": "Holy See", 1042 | "capital": "Rome", 1043 | "languages": [ 1044 | "Latin", 1045 | "Italian", 1046 | "French", 1047 | "German" 1048 | ], 1049 | "population": 451, 1050 | "flag": "https://restcountries.eu/data/vat.svg", 1051 | "currency": "Euro" 1052 | }, 1053 | { 1054 | "name": "Honduras", 1055 | "capital": "Tegucigalpa", 1056 | "languages": [ 1057 | "Spanish" 1058 | ], 1059 | "population": 8576532, 1060 | "flag": "https://restcountries.eu/data/hnd.svg", 1061 | "currency": "Honduran lempira" 1062 | }, 1063 | { 1064 | "name": "Hong Kong", 1065 | "capital": "City of Victoria", 1066 | "languages": [ 1067 | "English", 1068 | "Chinese" 1069 | ], 1070 | "population": 7324300, 1071 | "flag": "https://restcountries.eu/data/hkg.svg", 1072 | "currency": "Hong Kong dollar" 1073 | }, 1074 | { 1075 | "name": "Hungary", 1076 | "capital": "Budapest", 1077 | "languages": [ 1078 | "Hungarian" 1079 | ], 1080 | "population": 9823000, 1081 | "flag": "https://restcountries.eu/data/hun.svg", 1082 | "currency": "Hungarian forint" 1083 | }, 1084 | { 1085 | "name": "Iceland", 1086 | "capital": "Reykjavík", 1087 | "languages": [ 1088 | "Icelandic" 1089 | ], 1090 | "population": 334300, 1091 | "flag": "https://restcountries.eu/data/isl.svg", 1092 | "currency": "Icelandic króna" 1093 | }, 1094 | { 1095 | "name": "India", 1096 | "capital": "New Delhi", 1097 | "languages": [ 1098 | "Hindi", 1099 | "English" 1100 | ], 1101 | "population": 1295210000, 1102 | "flag": "https://restcountries.eu/data/ind.svg", 1103 | "currency": "Indian rupee" 1104 | }, 1105 | { 1106 | "name": "Indonesia", 1107 | "capital": "Jakarta", 1108 | "languages": [ 1109 | "Indonesian" 1110 | ], 1111 | "population": 258705000, 1112 | "flag": "https://restcountries.eu/data/idn.svg", 1113 | "currency": "Indonesian rupiah" 1114 | }, 1115 | { 1116 | "name": "Côte d'Ivoire", 1117 | "capital": "Yamoussoukro", 1118 | "languages": [ 1119 | "French" 1120 | ], 1121 | "population": 22671331, 1122 | "flag": "https://restcountries.eu/data/civ.svg", 1123 | "currency": "West African CFA franc" 1124 | }, 1125 | { 1126 | "name": "Iran (Islamic Republic of)", 1127 | "capital": "Tehran", 1128 | "languages": [ 1129 | "Persian (Farsi)" 1130 | ], 1131 | "population": 79369900, 1132 | "flag": "https://restcountries.eu/data/irn.svg", 1133 | "currency": "Iranian rial" 1134 | }, 1135 | { 1136 | "name": "Iraq", 1137 | "capital": "Baghdad", 1138 | "languages": [ 1139 | "Arabic", 1140 | "Kurdish" 1141 | ], 1142 | "population": 37883543, 1143 | "flag": "https://restcountries.eu/data/irq.svg", 1144 | "currency": "Iraqi dinar" 1145 | }, 1146 | { 1147 | "name": "Ireland", 1148 | "capital": "Dublin", 1149 | "languages": [ 1150 | "Irish", 1151 | "English" 1152 | ], 1153 | "population": 6378000, 1154 | "flag": "https://restcountries.eu/data/irl.svg", 1155 | "currency": "Euro" 1156 | }, 1157 | { 1158 | "name": "Isle of Man", 1159 | "capital": "Douglas", 1160 | "languages": [ 1161 | "English", 1162 | "Manx" 1163 | ], 1164 | "population": 84497, 1165 | "flag": "https://restcountries.eu/data/imn.svg", 1166 | "currency": "British pound" 1167 | }, 1168 | { 1169 | "name": "Israel", 1170 | "capital": "Jerusalem", 1171 | "languages": [ 1172 | "Hebrew (modern)", 1173 | "Arabic" 1174 | ], 1175 | "population": 8527400, 1176 | "flag": "https://restcountries.eu/data/isr.svg", 1177 | "currency": "Israeli new shekel" 1178 | }, 1179 | { 1180 | "name": "Italy", 1181 | "capital": "Rome", 1182 | "languages": [ 1183 | "Italian" 1184 | ], 1185 | "population": 60665551, 1186 | "flag": "https://restcountries.eu/data/ita.svg", 1187 | "currency": "Euro" 1188 | }, 1189 | { 1190 | "name": "Jamaica", 1191 | "capital": "Kingston", 1192 | "languages": [ 1193 | "English" 1194 | ], 1195 | "population": 2723246, 1196 | "flag": "https://restcountries.eu/data/jam.svg", 1197 | "currency": "Jamaican dollar" 1198 | }, 1199 | { 1200 | "name": "Japan", 1201 | "capital": "Tokyo", 1202 | "languages": [ 1203 | "Japanese" 1204 | ], 1205 | "population": 126960000, 1206 | "flag": "https://restcountries.eu/data/jpn.svg", 1207 | "currency": "Japanese yen" 1208 | }, 1209 | { 1210 | "name": "Jersey", 1211 | "capital": "Saint Helier", 1212 | "languages": [ 1213 | "English", 1214 | "French" 1215 | ], 1216 | "population": 100800, 1217 | "flag": "https://restcountries.eu/data/jey.svg", 1218 | "currency": "British pound" 1219 | }, 1220 | { 1221 | "name": "Jordan", 1222 | "capital": "Amman", 1223 | "languages": [ 1224 | "Arabic" 1225 | ], 1226 | "population": 9531712, 1227 | "flag": "https://restcountries.eu/data/jor.svg", 1228 | "currency": "Jordanian dinar" 1229 | }, 1230 | { 1231 | "name": "Kazakhstan", 1232 | "capital": "Astana", 1233 | "languages": [ 1234 | "Kazakh", 1235 | "Russian" 1236 | ], 1237 | "population": 17753200, 1238 | "flag": "https://restcountries.eu/data/kaz.svg", 1239 | "currency": "Kazakhstani tenge" 1240 | }, 1241 | { 1242 | "name": "Kenya", 1243 | "capital": "Nairobi", 1244 | "languages": [ 1245 | "English", 1246 | "Swahili" 1247 | ], 1248 | "population": 47251000, 1249 | "flag": "https://restcountries.eu/data/ken.svg", 1250 | "currency": "Kenyan shilling" 1251 | }, 1252 | { 1253 | "name": "Kiribati", 1254 | "capital": "South Tarawa", 1255 | "languages": [ 1256 | "English" 1257 | ], 1258 | "population": 113400, 1259 | "flag": "https://restcountries.eu/data/kir.svg", 1260 | "currency": "Australian dollar" 1261 | }, 1262 | { 1263 | "name": "Kuwait", 1264 | "capital": "Kuwait City", 1265 | "languages": [ 1266 | "Arabic" 1267 | ], 1268 | "population": 4183658, 1269 | "flag": "https://restcountries.eu/data/kwt.svg", 1270 | "currency": "Kuwaiti dinar" 1271 | }, 1272 | { 1273 | "name": "Kyrgyzstan", 1274 | "capital": "Bishkek", 1275 | "languages": [ 1276 | "Kyrgyz", 1277 | "Russian" 1278 | ], 1279 | "population": 6047800, 1280 | "flag": "https://restcountries.eu/data/kgz.svg", 1281 | "currency": "Kyrgyzstani som" 1282 | }, 1283 | { 1284 | "name": "Lao People's Democratic Republic", 1285 | "capital": "Vientiane", 1286 | "languages": [ 1287 | "Lao" 1288 | ], 1289 | "population": 6492400, 1290 | "flag": "https://restcountries.eu/data/lao.svg", 1291 | "currency": "Lao kip" 1292 | }, 1293 | { 1294 | "name": "Latvia", 1295 | "capital": "Riga", 1296 | "languages": [ 1297 | "Latvian" 1298 | ], 1299 | "population": 1961600, 1300 | "flag": "https://restcountries.eu/data/lva.svg", 1301 | "currency": "Euro" 1302 | }, 1303 | { 1304 | "name": "Lebanon", 1305 | "capital": "Beirut", 1306 | "languages": [ 1307 | "Arabic", 1308 | "French" 1309 | ], 1310 | "population": 5988000, 1311 | "flag": "https://restcountries.eu/data/lbn.svg", 1312 | "currency": "Lebanese pound" 1313 | }, 1314 | { 1315 | "name": "Lesotho", 1316 | "capital": "Maseru", 1317 | "languages": [ 1318 | "English", 1319 | "Southern Sotho" 1320 | ], 1321 | "population": 1894194, 1322 | "flag": "https://restcountries.eu/data/lso.svg", 1323 | "currency": "Lesotho loti" 1324 | }, 1325 | { 1326 | "name": "Liberia", 1327 | "capital": "Monrovia", 1328 | "languages": [ 1329 | "English" 1330 | ], 1331 | "population": 4615000, 1332 | "flag": "https://restcountries.eu/data/lbr.svg", 1333 | "currency": "Liberian dollar" 1334 | }, 1335 | { 1336 | "name": "Libya", 1337 | "capital": "Tripoli", 1338 | "languages": [ 1339 | "Arabic" 1340 | ], 1341 | "population": 6385000, 1342 | "flag": "https://restcountries.eu/data/lby.svg", 1343 | "currency": "Libyan dinar" 1344 | }, 1345 | { 1346 | "name": "Liechtenstein", 1347 | "capital": "Vaduz", 1348 | "languages": [ 1349 | "German" 1350 | ], 1351 | "population": 37623, 1352 | "flag": "https://restcountries.eu/data/lie.svg", 1353 | "currency": "Swiss franc" 1354 | }, 1355 | { 1356 | "name": "Lithuania", 1357 | "capital": "Vilnius", 1358 | "languages": [ 1359 | "Lithuanian" 1360 | ], 1361 | "population": 2872294, 1362 | "flag": "https://restcountries.eu/data/ltu.svg", 1363 | "currency": "Euro" 1364 | }, 1365 | { 1366 | "name": "Luxembourg", 1367 | "capital": "Luxembourg", 1368 | "languages": [ 1369 | "French", 1370 | "German", 1371 | "Luxembourgish" 1372 | ], 1373 | "population": 576200, 1374 | "flag": "https://restcountries.eu/data/lux.svg", 1375 | "currency": "Euro" 1376 | }, 1377 | { 1378 | "name": "Macao", 1379 | "capital": "", 1380 | "languages": [ 1381 | "Chinese", 1382 | "Portuguese" 1383 | ], 1384 | "population": 649100, 1385 | "flag": "https://restcountries.eu/data/mac.svg", 1386 | "currency": "Macanese pataca" 1387 | }, 1388 | { 1389 | "name": "Macedonia (the former Yugoslav Republic of)", 1390 | "capital": "Skopje", 1391 | "languages": [ 1392 | "Macedonian" 1393 | ], 1394 | "population": 2058539, 1395 | "flag": "https://restcountries.eu/data/mkd.svg", 1396 | "currency": "Macedonian denar" 1397 | }, 1398 | { 1399 | "name": "Madagascar", 1400 | "capital": "Antananarivo", 1401 | "languages": [ 1402 | "French", 1403 | "Malagasy" 1404 | ], 1405 | "population": 22434363, 1406 | "flag": "https://restcountries.eu/data/mdg.svg", 1407 | "currency": "Malagasy ariary" 1408 | }, 1409 | { 1410 | "name": "Malawi", 1411 | "capital": "Lilongwe", 1412 | "languages": [ 1413 | "English", 1414 | "Chichewa" 1415 | ], 1416 | "population": 16832910, 1417 | "flag": "https://restcountries.eu/data/mwi.svg", 1418 | "currency": "Malawian kwacha" 1419 | }, 1420 | { 1421 | "name": "Malaysia", 1422 | "capital": "Kuala Lumpur", 1423 | "languages": [ 1424 | "Malaysian" 1425 | ], 1426 | "population": 31405416, 1427 | "flag": "https://restcountries.eu/data/mys.svg", 1428 | "currency": "Malaysian ringgit" 1429 | }, 1430 | { 1431 | "name": "Maldives", 1432 | "capital": "Malé", 1433 | "languages": [ 1434 | "Divehi" 1435 | ], 1436 | "population": 344023, 1437 | "flag": "https://restcountries.eu/data/mdv.svg", 1438 | "currency": "Maldivian rufiyaa" 1439 | }, 1440 | { 1441 | "name": "Mali", 1442 | "capital": "Bamako", 1443 | "languages": [ 1444 | "French" 1445 | ], 1446 | "population": 18135000, 1447 | "flag": "https://restcountries.eu/data/mli.svg", 1448 | "currency": "West African CFA franc" 1449 | }, 1450 | { 1451 | "name": "Malta", 1452 | "capital": "Valletta", 1453 | "languages": [ 1454 | "Maltese", 1455 | "English" 1456 | ], 1457 | "population": 425384, 1458 | "flag": "https://restcountries.eu/data/mlt.svg", 1459 | "currency": "Euro" 1460 | }, 1461 | { 1462 | "name": "Marshall Islands", 1463 | "capital": "Majuro", 1464 | "languages": [ 1465 | "English", 1466 | "Marshallese" 1467 | ], 1468 | "population": 54880, 1469 | "flag": "https://restcountries.eu/data/mhl.svg", 1470 | "currency": "United States dollar" 1471 | }, 1472 | { 1473 | "name": "Martinique", 1474 | "capital": "Fort-de-France", 1475 | "languages": [ 1476 | "French" 1477 | ], 1478 | "population": 378243, 1479 | "flag": "https://restcountries.eu/data/mtq.svg", 1480 | "currency": "Euro" 1481 | }, 1482 | { 1483 | "name": "Mauritania", 1484 | "capital": "Nouakchott", 1485 | "languages": [ 1486 | "Arabic" 1487 | ], 1488 | "population": 3718678, 1489 | "flag": "https://restcountries.eu/data/mrt.svg", 1490 | "currency": "Mauritanian ouguiya" 1491 | }, 1492 | { 1493 | "name": "Mauritius", 1494 | "capital": "Port Louis", 1495 | "languages": [ 1496 | "English" 1497 | ], 1498 | "population": 1262879, 1499 | "flag": "https://restcountries.eu/data/mus.svg", 1500 | "currency": "Mauritian rupee" 1501 | }, 1502 | { 1503 | "name": "Mayotte", 1504 | "capital": "Mamoudzou", 1505 | "languages": [ 1506 | "French" 1507 | ], 1508 | "population": 226915, 1509 | "flag": "https://restcountries.eu/data/myt.svg", 1510 | "currency": "Euro" 1511 | }, 1512 | { 1513 | "name": "Mexico", 1514 | "capital": "Mexico City", 1515 | "languages": [ 1516 | "Spanish" 1517 | ], 1518 | "population": 122273473, 1519 | "flag": "https://restcountries.eu/data/mex.svg", 1520 | "currency": "Mexican peso" 1521 | }, 1522 | { 1523 | "name": "Micronesia (Federated States of)", 1524 | "capital": "Palikir", 1525 | "languages": [ 1526 | "English" 1527 | ], 1528 | "population": 102800, 1529 | "flag": "https://restcountries.eu/data/fsm.svg", 1530 | "currency": "[D]" 1531 | }, 1532 | { 1533 | "name": "Moldova (Republic of)", 1534 | "capital": "Chișinău", 1535 | "languages": [ 1536 | "Romanian" 1537 | ], 1538 | "population": 3553100, 1539 | "flag": "https://restcountries.eu/data/mda.svg", 1540 | "currency": "Moldovan leu" 1541 | }, 1542 | { 1543 | "name": "Monaco", 1544 | "capital": "Monaco", 1545 | "languages": [ 1546 | "French" 1547 | ], 1548 | "population": 38400, 1549 | "flag": "https://restcountries.eu/data/mco.svg", 1550 | "currency": "Euro" 1551 | }, 1552 | { 1553 | "name": "Mongolia", 1554 | "capital": "Ulan Bator", 1555 | "languages": [ 1556 | "Mongolian" 1557 | ], 1558 | "population": 3093100, 1559 | "flag": "https://restcountries.eu/data/mng.svg", 1560 | "currency": "Mongolian tögrög" 1561 | }, 1562 | { 1563 | "name": "Montenegro", 1564 | "capital": "Podgorica", 1565 | "languages": [ 1566 | "Serbian", 1567 | "Bosnian", 1568 | "Albanian", 1569 | "Croatian" 1570 | ], 1571 | "population": 621810, 1572 | "flag": "https://restcountries.eu/data/mne.svg", 1573 | "currency": "Euro" 1574 | }, 1575 | { 1576 | "name": "Montserrat", 1577 | "capital": "Plymouth", 1578 | "languages": [ 1579 | "English" 1580 | ], 1581 | "population": 4922, 1582 | "flag": "https://restcountries.eu/data/msr.svg", 1583 | "currency": "East Caribbean dollar" 1584 | }, 1585 | { 1586 | "name": "Morocco", 1587 | "capital": "Rabat", 1588 | "languages": [ 1589 | "Arabic" 1590 | ], 1591 | "population": 33337529, 1592 | "flag": "https://restcountries.eu/data/mar.svg", 1593 | "currency": "Moroccan dirham" 1594 | }, 1595 | { 1596 | "name": "Mozambique", 1597 | "capital": "Maputo", 1598 | "languages": [ 1599 | "Portuguese" 1600 | ], 1601 | "population": 26423700, 1602 | "flag": "https://restcountries.eu/data/moz.svg", 1603 | "currency": "Mozambican metical" 1604 | }, 1605 | { 1606 | "name": "Myanmar", 1607 | "capital": "Naypyidaw", 1608 | "languages": [ 1609 | "Burmese" 1610 | ], 1611 | "population": 51419420, 1612 | "flag": "https://restcountries.eu/data/mmr.svg", 1613 | "currency": "Burmese kyat" 1614 | }, 1615 | { 1616 | "name": "Namibia", 1617 | "capital": "Windhoek", 1618 | "languages": [ 1619 | "English", 1620 | "Afrikaans" 1621 | ], 1622 | "population": 2324388, 1623 | "flag": "https://restcountries.eu/data/nam.svg", 1624 | "currency": "Namibian dollar" 1625 | }, 1626 | { 1627 | "name": "Nauru", 1628 | "capital": "Yaren", 1629 | "languages": [ 1630 | "English", 1631 | "Nauruan" 1632 | ], 1633 | "population": 10084, 1634 | "flag": "https://restcountries.eu/data/nru.svg", 1635 | "currency": "Australian dollar" 1636 | }, 1637 | { 1638 | "name": "Nepal", 1639 | "capital": "Kathmandu", 1640 | "languages": [ 1641 | "Nepali" 1642 | ], 1643 | "population": 28431500, 1644 | "flag": "https://restcountries.eu/data/npl.svg", 1645 | "currency": "Nepalese rupee" 1646 | }, 1647 | { 1648 | "name": "Netherlands", 1649 | "capital": "Amsterdam", 1650 | "languages": [ 1651 | "Dutch" 1652 | ], 1653 | "population": 17019800, 1654 | "flag": "https://restcountries.eu/data/nld.svg", 1655 | "currency": "Euro" 1656 | }, 1657 | { 1658 | "name": "New Caledonia", 1659 | "capital": "Nouméa", 1660 | "languages": [ 1661 | "French" 1662 | ], 1663 | "population": 268767, 1664 | "flag": "https://restcountries.eu/data/ncl.svg", 1665 | "currency": "CFP franc" 1666 | }, 1667 | { 1668 | "name": "New Zealand", 1669 | "capital": "Wellington", 1670 | "languages": [ 1671 | "English", 1672 | "Māori" 1673 | ], 1674 | "population": 4697854, 1675 | "flag": "https://restcountries.eu/data/nzl.svg", 1676 | "currency": "New Zealand dollar" 1677 | }, 1678 | { 1679 | "name": "Nicaragua", 1680 | "capital": "Managua", 1681 | "languages": [ 1682 | "Spanish" 1683 | ], 1684 | "population": 6262703, 1685 | "flag": "https://restcountries.eu/data/nic.svg", 1686 | "currency": "Nicaraguan córdoba" 1687 | }, 1688 | { 1689 | "name": "Niger", 1690 | "capital": "Niamey", 1691 | "languages": [ 1692 | "French" 1693 | ], 1694 | "population": 20715000, 1695 | "flag": "https://restcountries.eu/data/ner.svg", 1696 | "currency": "West African CFA franc" 1697 | }, 1698 | { 1699 | "name": "Nigeria", 1700 | "capital": "Abuja", 1701 | "languages": [ 1702 | "English" 1703 | ], 1704 | "population": 186988000, 1705 | "flag": "https://restcountries.eu/data/nga.svg", 1706 | "currency": "Nigerian naira" 1707 | }, 1708 | { 1709 | "name": "Niue", 1710 | "capital": "Alofi", 1711 | "languages": [ 1712 | "English" 1713 | ], 1714 | "population": 1470, 1715 | "flag": "https://restcountries.eu/data/niu.svg", 1716 | "currency": "New Zealand dollar" 1717 | }, 1718 | { 1719 | "name": "Norfolk Island", 1720 | "capital": "Kingston", 1721 | "languages": [ 1722 | "English" 1723 | ], 1724 | "population": 2302, 1725 | "flag": "https://restcountries.eu/data/nfk.svg", 1726 | "currency": "Australian dollar" 1727 | }, 1728 | { 1729 | "name": "Korea (Democratic People's Republic of)", 1730 | "capital": "Pyongyang", 1731 | "languages": [ 1732 | "Korean" 1733 | ], 1734 | "population": 25281000, 1735 | "flag": "https://restcountries.eu/data/prk.svg", 1736 | "currency": "North Korean won" 1737 | }, 1738 | { 1739 | "name": "Northern Mariana Islands", 1740 | "capital": "Saipan", 1741 | "languages": [ 1742 | "English", 1743 | "Chamorro" 1744 | ], 1745 | "population": 56940, 1746 | "flag": "https://restcountries.eu/data/mnp.svg", 1747 | "currency": "United States dollar" 1748 | }, 1749 | { 1750 | "name": "Norway", 1751 | "capital": "Oslo", 1752 | "languages": [ 1753 | "Norwegian", 1754 | "Norwegian Bokmål", 1755 | "Norwegian Nynorsk" 1756 | ], 1757 | "population": 5223256, 1758 | "flag": "https://restcountries.eu/data/nor.svg", 1759 | "currency": "Norwegian krone" 1760 | }, 1761 | { 1762 | "name": "Oman", 1763 | "capital": "Muscat", 1764 | "languages": [ 1765 | "Arabic" 1766 | ], 1767 | "population": 4420133, 1768 | "flag": "https://restcountries.eu/data/omn.svg", 1769 | "currency": "Omani rial" 1770 | }, 1771 | { 1772 | "name": "Pakistan", 1773 | "capital": "Islamabad", 1774 | "languages": [ 1775 | "English", 1776 | "Urdu" 1777 | ], 1778 | "population": 194125062, 1779 | "flag": "https://restcountries.eu/data/pak.svg", 1780 | "currency": "Pakistani rupee" 1781 | }, 1782 | { 1783 | "name": "Palau", 1784 | "capital": "Ngerulmud", 1785 | "languages": [ 1786 | "English" 1787 | ], 1788 | "population": 17950, 1789 | "flag": "https://restcountries.eu/data/plw.svg", 1790 | "currency": "[E]" 1791 | }, 1792 | { 1793 | "name": "Palestine, State of", 1794 | "capital": "Ramallah", 1795 | "languages": [ 1796 | "Arabic" 1797 | ], 1798 | "population": 4682467, 1799 | "flag": "https://restcountries.eu/data/pse.svg", 1800 | "currency": "Israeli new sheqel" 1801 | }, 1802 | { 1803 | "name": "Panama", 1804 | "capital": "Panama City", 1805 | "languages": [ 1806 | "Spanish" 1807 | ], 1808 | "population": 3814672, 1809 | "flag": "https://restcountries.eu/data/pan.svg", 1810 | "currency": "Panamanian balboa" 1811 | }, 1812 | { 1813 | "name": "Papua New Guinea", 1814 | "capital": "Port Moresby", 1815 | "languages": [ 1816 | "English" 1817 | ], 1818 | "population": 8083700, 1819 | "flag": "https://restcountries.eu/data/png.svg", 1820 | "currency": "Papua New Guinean kina" 1821 | }, 1822 | { 1823 | "name": "Paraguay", 1824 | "capital": "Asunción", 1825 | "languages": [ 1826 | "Spanish", 1827 | "Guaraní" 1828 | ], 1829 | "population": 6854536, 1830 | "flag": "https://restcountries.eu/data/pry.svg", 1831 | "currency": "Paraguayan guaraní" 1832 | }, 1833 | { 1834 | "name": "Peru", 1835 | "capital": "Lima", 1836 | "languages": [ 1837 | "Spanish" 1838 | ], 1839 | "population": 31488700, 1840 | "flag": "https://restcountries.eu/data/per.svg", 1841 | "currency": "Peruvian sol" 1842 | }, 1843 | { 1844 | "name": "Philippines", 1845 | "capital": "Manila", 1846 | "languages": [ 1847 | "English" 1848 | ], 1849 | "population": 103279800, 1850 | "flag": "https://restcountries.eu/data/phl.svg", 1851 | "currency": "Philippine peso" 1852 | }, 1853 | { 1854 | "name": "Pitcairn", 1855 | "capital": "Adamstown", 1856 | "languages": [ 1857 | "English" 1858 | ], 1859 | "population": 56, 1860 | "flag": "https://restcountries.eu/data/pcn.svg", 1861 | "currency": "New Zealand dollar" 1862 | }, 1863 | { 1864 | "name": "Poland", 1865 | "capital": "Warsaw", 1866 | "languages": [ 1867 | "Polish" 1868 | ], 1869 | "population": 38437239, 1870 | "flag": "https://restcountries.eu/data/pol.svg", 1871 | "currency": "Polish złoty" 1872 | }, 1873 | { 1874 | "name": "Portugal", 1875 | "capital": "Lisbon", 1876 | "languages": [ 1877 | "Portuguese" 1878 | ], 1879 | "population": 10374822, 1880 | "flag": "https://restcountries.eu/data/prt.svg", 1881 | "currency": "Euro" 1882 | }, 1883 | { 1884 | "name": "Puerto Rico", 1885 | "capital": "San Juan", 1886 | "languages": [ 1887 | "Spanish", 1888 | "English" 1889 | ], 1890 | "population": 3474182, 1891 | "flag": "https://restcountries.eu/data/pri.svg", 1892 | "currency": "United States dollar" 1893 | }, 1894 | { 1895 | "name": "Qatar", 1896 | "capital": "Doha", 1897 | "languages": [ 1898 | "Arabic" 1899 | ], 1900 | "population": 2587564, 1901 | "flag": "https://restcountries.eu/data/qat.svg", 1902 | "currency": "Qatari riyal" 1903 | }, 1904 | { 1905 | "name": "Republic of Kosovo", 1906 | "capital": "Pristina", 1907 | "languages": [ 1908 | "Albanian", 1909 | "Serbian" 1910 | ], 1911 | "population": 1733842, 1912 | "flag": "https://restcountries.eu/data/kos.svg", 1913 | "currency": "Euro" 1914 | }, 1915 | { 1916 | "name": "Réunion", 1917 | "capital": "Saint-Denis", 1918 | "languages": [ 1919 | "French" 1920 | ], 1921 | "population": 840974, 1922 | "flag": "https://restcountries.eu/data/reu.svg", 1923 | "currency": "Euro" 1924 | }, 1925 | { 1926 | "name": "Romania", 1927 | "capital": "Bucharest", 1928 | "languages": [ 1929 | "Romanian" 1930 | ], 1931 | "population": 19861408, 1932 | "flag": "https://restcountries.eu/data/rou.svg", 1933 | "currency": "Romanian leu" 1934 | }, 1935 | { 1936 | "name": "Russian Federation", 1937 | "capital": "Moscow", 1938 | "languages": [ 1939 | "Russian" 1940 | ], 1941 | "population": 146599183, 1942 | "flag": "https://restcountries.eu/data/rus.svg", 1943 | "currency": "Russian ruble" 1944 | }, 1945 | { 1946 | "name": "Rwanda", 1947 | "capital": "Kigali", 1948 | "languages": [ 1949 | "Kinyarwanda", 1950 | "English", 1951 | "French" 1952 | ], 1953 | "population": 11553188, 1954 | "flag": "https://restcountries.eu/data/rwa.svg", 1955 | "currency": "Rwandan franc" 1956 | }, 1957 | { 1958 | "name": "Saint Barthélemy", 1959 | "capital": "Gustavia", 1960 | "languages": [ 1961 | "French" 1962 | ], 1963 | "population": 9417, 1964 | "flag": "https://restcountries.eu/data/blm.svg", 1965 | "currency": "Euro" 1966 | }, 1967 | { 1968 | "name": "Saint Helena, Ascension and Tristan da Cunha", 1969 | "capital": "Jamestown", 1970 | "languages": [ 1971 | "English" 1972 | ], 1973 | "population": 4255, 1974 | "flag": "https://restcountries.eu/data/shn.svg", 1975 | "currency": "Saint Helena pound" 1976 | }, 1977 | { 1978 | "name": "Saint Kitts and Nevis", 1979 | "capital": "Basseterre", 1980 | "languages": [ 1981 | "English" 1982 | ], 1983 | "population": 46204, 1984 | "flag": "https://restcountries.eu/data/kna.svg", 1985 | "currency": "East Caribbean dollar" 1986 | }, 1987 | { 1988 | "name": "Saint Lucia", 1989 | "capital": "Castries", 1990 | "languages": [ 1991 | "English" 1992 | ], 1993 | "population": 186000, 1994 | "flag": "https://restcountries.eu/data/lca.svg", 1995 | "currency": "East Caribbean dollar" 1996 | }, 1997 | { 1998 | "name": "Saint Martin (French part)", 1999 | "capital": "Marigot", 2000 | "languages": [ 2001 | "English", 2002 | "French", 2003 | "Dutch" 2004 | ], 2005 | "population": 36979, 2006 | "flag": "https://restcountries.eu/data/maf.svg", 2007 | "currency": "Euro" 2008 | }, 2009 | { 2010 | "name": "Saint Pierre and Miquelon", 2011 | "capital": "Saint-Pierre", 2012 | "languages": [ 2013 | "French" 2014 | ], 2015 | "population": 6069, 2016 | "flag": "https://restcountries.eu/data/spm.svg", 2017 | "currency": "Euro" 2018 | }, 2019 | { 2020 | "name": "Saint Vincent and the Grenadines", 2021 | "capital": "Kingstown", 2022 | "languages": [ 2023 | "English" 2024 | ], 2025 | "population": 109991, 2026 | "flag": "https://restcountries.eu/data/vct.svg", 2027 | "currency": "East Caribbean dollar" 2028 | }, 2029 | { 2030 | "name": "Samoa", 2031 | "capital": "Apia", 2032 | "languages": [ 2033 | "Samoan", 2034 | "English" 2035 | ], 2036 | "population": 194899, 2037 | "flag": "https://restcountries.eu/data/wsm.svg", 2038 | "currency": "Samoan tālā" 2039 | }, 2040 | { 2041 | "name": "San Marino", 2042 | "capital": "City of San Marino", 2043 | "languages": [ 2044 | "Italian" 2045 | ], 2046 | "population": 33005, 2047 | "flag": "https://restcountries.eu/data/smr.svg", 2048 | "currency": "Euro" 2049 | }, 2050 | { 2051 | "name": "Sao Tome and Principe", 2052 | "capital": "São Tomé", 2053 | "languages": [ 2054 | "Portuguese" 2055 | ], 2056 | "population": 187356, 2057 | "flag": "https://restcountries.eu/data/stp.svg", 2058 | "currency": "São Tomé and Príncipe dobra" 2059 | }, 2060 | { 2061 | "name": "Saudi Arabia", 2062 | "capital": "Riyadh", 2063 | "languages": [ 2064 | "Arabic" 2065 | ], 2066 | "population": 32248200, 2067 | "flag": "https://restcountries.eu/data/sau.svg", 2068 | "currency": "Saudi riyal" 2069 | }, 2070 | { 2071 | "name": "Senegal", 2072 | "capital": "Dakar", 2073 | "languages": [ 2074 | "French" 2075 | ], 2076 | "population": 14799859, 2077 | "flag": "https://restcountries.eu/data/sen.svg", 2078 | "currency": "West African CFA franc" 2079 | }, 2080 | { 2081 | "name": "Serbia", 2082 | "capital": "Belgrade", 2083 | "languages": [ 2084 | "Serbian" 2085 | ], 2086 | "population": 7076372, 2087 | "flag": "https://restcountries.eu/data/srb.svg", 2088 | "currency": "Serbian dinar" 2089 | }, 2090 | { 2091 | "name": "Seychelles", 2092 | "capital": "Victoria", 2093 | "languages": [ 2094 | "French", 2095 | "English" 2096 | ], 2097 | "population": 91400, 2098 | "flag": "https://restcountries.eu/data/syc.svg", 2099 | "currency": "Seychellois rupee" 2100 | }, 2101 | { 2102 | "name": "Sierra Leone", 2103 | "capital": "Freetown", 2104 | "languages": [ 2105 | "English" 2106 | ], 2107 | "population": 7075641, 2108 | "flag": "https://restcountries.eu/data/sle.svg", 2109 | "currency": "Sierra Leonean leone" 2110 | }, 2111 | { 2112 | "name": "Singapore", 2113 | "capital": "Singapore", 2114 | "languages": [ 2115 | "English", 2116 | "Malay", 2117 | "Tamil", 2118 | "Chinese" 2119 | ], 2120 | "population": 5535000, 2121 | "flag": "https://restcountries.eu/data/sgp.svg", 2122 | "currency": "Brunei dollar" 2123 | }, 2124 | { 2125 | "name": "Sint Maarten (Dutch part)", 2126 | "capital": "Philipsburg", 2127 | "languages": [ 2128 | "Dutch", 2129 | "English" 2130 | ], 2131 | "population": 38247, 2132 | "flag": "https://restcountries.eu/data/sxm.svg", 2133 | "currency": "Netherlands Antillean guilder" 2134 | }, 2135 | { 2136 | "name": "Slovakia", 2137 | "capital": "Bratislava", 2138 | "languages": [ 2139 | "Slovak" 2140 | ], 2141 | "population": 5426252, 2142 | "flag": "https://restcountries.eu/data/svk.svg", 2143 | "currency": "Euro" 2144 | }, 2145 | { 2146 | "name": "Slovenia", 2147 | "capital": "Ljubljana", 2148 | "languages": [ 2149 | "Slovene" 2150 | ], 2151 | "population": 2064188, 2152 | "flag": "https://restcountries.eu/data/svn.svg", 2153 | "currency": "Euro" 2154 | }, 2155 | { 2156 | "name": "Solomon Islands", 2157 | "capital": "Honiara", 2158 | "languages": [ 2159 | "English" 2160 | ], 2161 | "population": 642000, 2162 | "flag": "https://restcountries.eu/data/slb.svg", 2163 | "currency": "Solomon Islands dollar" 2164 | }, 2165 | { 2166 | "name": "Somalia", 2167 | "capital": "Mogadishu", 2168 | "languages": [ 2169 | "Somali", 2170 | "Arabic" 2171 | ], 2172 | "population": 11079000, 2173 | "flag": "https://restcountries.eu/data/som.svg", 2174 | "currency": "Somali shilling" 2175 | }, 2176 | { 2177 | "name": "South Africa", 2178 | "capital": "Pretoria", 2179 | "languages": [ 2180 | "Afrikaans", 2181 | "English", 2182 | "Southern Ndebele", 2183 | "Southern Sotho", 2184 | "Swati", 2185 | "Tswana", 2186 | "Tsonga", 2187 | "Venda", 2188 | "Xhosa", 2189 | "Zulu" 2190 | ], 2191 | "population": 55653654, 2192 | "flag": "https://restcountries.eu/data/zaf.svg", 2193 | "currency": "South African rand" 2194 | }, 2195 | { 2196 | "name": "South Georgia and the South Sandwich Islands", 2197 | "capital": "King Edward Point", 2198 | "languages": [ 2199 | "English" 2200 | ], 2201 | "population": 30, 2202 | "flag": "https://restcountries.eu/data/sgs.svg", 2203 | "currency": "British pound" 2204 | }, 2205 | { 2206 | "name": "Korea (Republic of)", 2207 | "capital": "Seoul", 2208 | "languages": [ 2209 | "Korean" 2210 | ], 2211 | "population": 50801405, 2212 | "flag": "https://restcountries.eu/data/kor.svg", 2213 | "currency": "South Korean won" 2214 | }, 2215 | { 2216 | "name": "South Sudan", 2217 | "capital": "Juba", 2218 | "languages": [ 2219 | "English" 2220 | ], 2221 | "population": 12131000, 2222 | "flag": "https://restcountries.eu/data/ssd.svg", 2223 | "currency": "South Sudanese pound" 2224 | }, 2225 | { 2226 | "name": "Spain", 2227 | "capital": "Madrid", 2228 | "languages": [ 2229 | "Spanish" 2230 | ], 2231 | "population": 46438422, 2232 | "flag": "https://restcountries.eu/data/esp.svg", 2233 | "currency": "Euro" 2234 | }, 2235 | { 2236 | "name": "Sri Lanka", 2237 | "capital": "Colombo", 2238 | "languages": [ 2239 | "Sinhalese", 2240 | "Tamil" 2241 | ], 2242 | "population": 20966000, 2243 | "flag": "https://restcountries.eu/data/lka.svg", 2244 | "currency": "Sri Lankan rupee" 2245 | }, 2246 | { 2247 | "name": "Sudan", 2248 | "capital": "Khartoum", 2249 | "languages": [ 2250 | "Arabic", 2251 | "English" 2252 | ], 2253 | "population": 39598700, 2254 | "flag": "https://restcountries.eu/data/sdn.svg", 2255 | "currency": "Sudanese pound" 2256 | }, 2257 | { 2258 | "name": "Suriname", 2259 | "capital": "Paramaribo", 2260 | "languages": [ 2261 | "Dutch" 2262 | ], 2263 | "population": 541638, 2264 | "flag": "https://restcountries.eu/data/sur.svg", 2265 | "currency": "Surinamese dollar" 2266 | }, 2267 | { 2268 | "name": "Svalbard and Jan Mayen", 2269 | "capital": "Longyearbyen", 2270 | "languages": [ 2271 | "Norwegian" 2272 | ], 2273 | "population": 2562, 2274 | "flag": "https://restcountries.eu/data/sjm.svg", 2275 | "currency": "Norwegian krone" 2276 | }, 2277 | { 2278 | "name": "Swaziland", 2279 | "capital": "Lobamba", 2280 | "languages": [ 2281 | "English", 2282 | "Swati" 2283 | ], 2284 | "population": 1132657, 2285 | "flag": "https://restcountries.eu/data/swz.svg", 2286 | "currency": "Swazi lilangeni" 2287 | }, 2288 | { 2289 | "name": "Sweden", 2290 | "capital": "Stockholm", 2291 | "languages": [ 2292 | "Swedish" 2293 | ], 2294 | "population": 9894888, 2295 | "flag": "https://restcountries.eu/data/swe.svg", 2296 | "currency": "Swedish krona" 2297 | }, 2298 | { 2299 | "name": "Switzerland", 2300 | "capital": "Bern", 2301 | "languages": [ 2302 | "German", 2303 | "French", 2304 | "Italian" 2305 | ], 2306 | "population": 8341600, 2307 | "flag": "https://restcountries.eu/data/che.svg", 2308 | "currency": "Swiss franc" 2309 | }, 2310 | { 2311 | "name": "Syrian Arab Republic", 2312 | "capital": "Damascus", 2313 | "languages": [ 2314 | "Arabic" 2315 | ], 2316 | "population": 18564000, 2317 | "flag": "https://restcountries.eu/data/syr.svg", 2318 | "currency": "Syrian pound" 2319 | }, 2320 | { 2321 | "name": "Taiwan", 2322 | "capital": "Taipei", 2323 | "languages": [ 2324 | "Chinese" 2325 | ], 2326 | "population": 23503349, 2327 | "flag": "https://restcountries.eu/data/twn.svg", 2328 | "currency": "New Taiwan dollar" 2329 | }, 2330 | { 2331 | "name": "Tajikistan", 2332 | "capital": "Dushanbe", 2333 | "languages": [ 2334 | "Tajik", 2335 | "Russian" 2336 | ], 2337 | "population": 8593600, 2338 | "flag": "https://restcountries.eu/data/tjk.svg", 2339 | "currency": "Tajikistani somoni" 2340 | }, 2341 | { 2342 | "name": "Tanzania, United Republic of", 2343 | "capital": "Dodoma", 2344 | "languages": [ 2345 | "Swahili", 2346 | "English" 2347 | ], 2348 | "population": 55155000, 2349 | "flag": "https://restcountries.eu/data/tza.svg", 2350 | "currency": "Tanzanian shilling" 2351 | }, 2352 | { 2353 | "name": "Thailand", 2354 | "capital": "Bangkok", 2355 | "languages": [ 2356 | "Thai" 2357 | ], 2358 | "population": 65327652, 2359 | "flag": "https://restcountries.eu/data/tha.svg", 2360 | "currency": "Thai baht" 2361 | }, 2362 | { 2363 | "name": "Timor-Leste", 2364 | "capital": "Dili", 2365 | "languages": [ 2366 | "Portuguese" 2367 | ], 2368 | "population": 1167242, 2369 | "flag": "https://restcountries.eu/data/tls.svg", 2370 | "currency": "United States dollar" 2371 | }, 2372 | { 2373 | "name": "Togo", 2374 | "capital": "Lomé", 2375 | "languages": [ 2376 | "French" 2377 | ], 2378 | "population": 7143000, 2379 | "flag": "https://restcountries.eu/data/tgo.svg", 2380 | "currency": "West African CFA franc" 2381 | }, 2382 | { 2383 | "name": "Tokelau", 2384 | "capital": "Fakaofo", 2385 | "languages": [ 2386 | "English" 2387 | ], 2388 | "population": 1411, 2389 | "flag": "https://restcountries.eu/data/tkl.svg", 2390 | "currency": "New Zealand dollar" 2391 | }, 2392 | { 2393 | "name": "Tonga", 2394 | "capital": "Nuku'alofa", 2395 | "languages": [ 2396 | "English", 2397 | "Tonga (Tonga Islands)" 2398 | ], 2399 | "population": 103252, 2400 | "flag": "https://restcountries.eu/data/ton.svg", 2401 | "currency": "Tongan paʻanga" 2402 | }, 2403 | { 2404 | "name": "Trinidad and Tobago", 2405 | "capital": "Port of Spain", 2406 | "languages": [ 2407 | "English" 2408 | ], 2409 | "population": 1349667, 2410 | "flag": "https://restcountries.eu/data/tto.svg", 2411 | "currency": "Trinidad and Tobago dollar" 2412 | }, 2413 | { 2414 | "name": "Tunisia", 2415 | "capital": "Tunis", 2416 | "languages": [ 2417 | "Arabic" 2418 | ], 2419 | "population": 11154400, 2420 | "flag": "https://restcountries.eu/data/tun.svg", 2421 | "currency": "Tunisian dinar" 2422 | }, 2423 | { 2424 | "name": "Turkey", 2425 | "capital": "Ankara", 2426 | "languages": [ 2427 | "Turkish" 2428 | ], 2429 | "population": 78741053, 2430 | "flag": "https://restcountries.eu/data/tur.svg", 2431 | "currency": "Turkish lira" 2432 | }, 2433 | { 2434 | "name": "Turkmenistan", 2435 | "capital": "Ashgabat", 2436 | "languages": [ 2437 | "Turkmen", 2438 | "Russian" 2439 | ], 2440 | "population": 4751120, 2441 | "flag": "https://restcountries.eu/data/tkm.svg", 2442 | "currency": "Turkmenistan manat" 2443 | }, 2444 | { 2445 | "name": "Turks and Caicos Islands", 2446 | "capital": "Cockburn Town", 2447 | "languages": [ 2448 | "English" 2449 | ], 2450 | "population": 31458, 2451 | "flag": "https://restcountries.eu/data/tca.svg", 2452 | "currency": "United States dollar" 2453 | }, 2454 | { 2455 | "name": "Tuvalu", 2456 | "capital": "Funafuti", 2457 | "languages": [ 2458 | "English" 2459 | ], 2460 | "population": 10640, 2461 | "flag": "https://restcountries.eu/data/tuv.svg", 2462 | "currency": "Australian dollar" 2463 | }, 2464 | { 2465 | "name": "Uganda", 2466 | "capital": "Kampala", 2467 | "languages": [ 2468 | "English", 2469 | "Swahili" 2470 | ], 2471 | "population": 33860700, 2472 | "flag": "https://restcountries.eu/data/uga.svg", 2473 | "currency": "Ugandan shilling" 2474 | }, 2475 | { 2476 | "name": "Ukraine", 2477 | "capital": "Kiev", 2478 | "languages": [ 2479 | "Ukrainian" 2480 | ], 2481 | "population": 42692393, 2482 | "flag": "https://restcountries.eu/data/ukr.svg", 2483 | "currency": "Ukrainian hryvnia" 2484 | }, 2485 | { 2486 | "name": "United Arab Emirates", 2487 | "capital": "Abu Dhabi", 2488 | "languages": [ 2489 | "Arabic" 2490 | ], 2491 | "population": 9856000, 2492 | "flag": "https://restcountries.eu/data/are.svg", 2493 | "currency": "United Arab Emirates dirham" 2494 | }, 2495 | { 2496 | "name": "United Kingdom of Great Britain and Northern Ireland", 2497 | "capital": "London", 2498 | "languages": [ 2499 | "English" 2500 | ], 2501 | "population": 65110000, 2502 | "flag": "https://restcountries.eu/data/gbr.svg", 2503 | "currency": "British pound" 2504 | }, 2505 | { 2506 | "name": "United States of America", 2507 | "capital": "Washington, D.C.", 2508 | "languages": [ 2509 | "English" 2510 | ], 2511 | "population": 323947000, 2512 | "flag": "https://restcountries.eu/data/usa.svg", 2513 | "currency": "United States dollar" 2514 | }, 2515 | { 2516 | "name": "Uruguay", 2517 | "capital": "Montevideo", 2518 | "languages": [ 2519 | "Spanish" 2520 | ], 2521 | "population": 3480222, 2522 | "flag": "https://restcountries.eu/data/ury.svg", 2523 | "currency": "Uruguayan peso" 2524 | }, 2525 | { 2526 | "name": "Uzbekistan", 2527 | "capital": "Tashkent", 2528 | "languages": [ 2529 | "Uzbek", 2530 | "Russian" 2531 | ], 2532 | "population": 31576400, 2533 | "flag": "https://restcountries.eu/data/uzb.svg", 2534 | "currency": "Uzbekistani so'm" 2535 | }, 2536 | { 2537 | "name": "Vanuatu", 2538 | "capital": "Port Vila", 2539 | "languages": [ 2540 | "Bislama", 2541 | "English", 2542 | "French" 2543 | ], 2544 | "population": 277500, 2545 | "flag": "https://restcountries.eu/data/vut.svg", 2546 | "currency": "Vanuatu vatu" 2547 | }, 2548 | { 2549 | "name": "Venezuela (Bolivarian Republic of)", 2550 | "capital": "Caracas", 2551 | "languages": [ 2552 | "Spanish" 2553 | ], 2554 | "population": 31028700, 2555 | "flag": "https://restcountries.eu/data/ven.svg", 2556 | "currency": "Venezuelan bolívar" 2557 | }, 2558 | { 2559 | "name": "Viet Nam", 2560 | "capital": "Hanoi", 2561 | "languages": [ 2562 | "Vietnamese" 2563 | ], 2564 | "population": 92700000, 2565 | "flag": "https://restcountries.eu/data/vnm.svg", 2566 | "currency": "Vietnamese đồng" 2567 | }, 2568 | { 2569 | "name": "Wallis and Futuna", 2570 | "capital": "Mata-Utu", 2571 | "languages": [ 2572 | "French" 2573 | ], 2574 | "population": 11750, 2575 | "flag": "https://restcountries.eu/data/wlf.svg", 2576 | "currency": "CFP franc" 2577 | }, 2578 | { 2579 | "name": "Western Sahara", 2580 | "capital": "El Aaiún", 2581 | "languages": [ 2582 | "Spanish" 2583 | ], 2584 | "population": 510713, 2585 | "flag": "https://restcountries.eu/data/esh.svg", 2586 | "currency": "Moroccan dirham" 2587 | }, 2588 | { 2589 | "name": "Yemen", 2590 | "capital": "Sana'a", 2591 | "languages": [ 2592 | "Arabic" 2593 | ], 2594 | "population": 27478000, 2595 | "flag": "https://restcountries.eu/data/yem.svg", 2596 | "currency": "Yemeni rial" 2597 | }, 2598 | { 2599 | "name": "Zambia", 2600 | "capital": "Lusaka", 2601 | "languages": [ 2602 | "English" 2603 | ], 2604 | "population": 15933883, 2605 | "flag": "https://restcountries.eu/data/zmb.svg", 2606 | "currency": "Zambian kwacha" 2607 | }, 2608 | { 2609 | "name": "Zimbabwe", 2610 | "capital": "Harare", 2611 | "languages": [ 2612 | "English", 2613 | "Shona", 2614 | "Northern Ndebele" 2615 | ], 2616 | "population": 14240168, 2617 | "flag": "https://restcountries.eu/data/zwe.svg", 2618 | "currency": "Botswana pula" 2619 | } 2620 | ] -------------------------------------------------------------------------------- /favicon/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/favicon/android-chrome-192x192.png -------------------------------------------------------------------------------- /favicon/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/favicon/android-chrome-512x512.png -------------------------------------------------------------------------------- /favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/favicon/favicon.ico -------------------------------------------------------------------------------- /favicon/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} -------------------------------------------------------------------------------- /images/Pandas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/images/Pandas.png -------------------------------------------------------------------------------- /images/icon.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/images/icon.PNG -------------------------------------------------------------------------------- /images/pandas-dataframe-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/images/pandas-dataframe-1.png -------------------------------------------------------------------------------- /images/pandas-dataframe-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/images/pandas-dataframe-2.png -------------------------------------------------------------------------------- /images/pandas-series-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/images/pandas-series-1.png -------------------------------------------------------------------------------- /images/pandas-series-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/images/pandas-series-2.png -------------------------------------------------------------------------------- /images/pandas-series-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asabeneh/Pandas/c43302aa2504a7ab4345c446619f44d0d60b884e/images/pandas-series-3.png -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | [![Pandas Leson](./images/Pandas.png)](https://github.com/Asabeneh/Pandas/blob/main/pandas.ipynb) 2 | --------------------------------------------------------------------------------