Last active
February 15, 2024 18:18
-
-
Save ardzz/c39074597ad5af5976a19a28d850cb55 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 44, | |
"metadata": { | |
"collapsed": true, | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:15.951453600Z", | |
"start_time": "2024-02-13T03:30:15.842160Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"import pandas as pd" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"outputs": [], | |
"source": [ | |
"indc=pd.read_csv(\"ebola.csv\")" | |
], | |
"metadata": { | |
"collapsed": false | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 46, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.014596Z", | |
"start_time": "2024-02-13T03:30:15.980162500Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": " Indicator Country Date \\\n0 Cumulative number of confirmed, probable and s... Guinea 2015-03-10 \n1 Cumulative number of confirmed Ebola cases Guinea 2015-03-10 \n2 Cumulative number of probable Ebola cases Guinea 2015-03-10 \n3 Cumulative number of suspected Ebola cases Guinea 2015-03-10 \n4 Cumulative number of confirmed, probable and s... Guinea 2015-03-10 \n\n value \n0 3285.0 \n1 2871.0 \n2 392.0 \n3 22.0 \n4 2170.0 ", | |
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>Indicator</th>\n <th>Country</th>\n <th>Date</th>\n <th>value</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>Cumulative number of confirmed, probable and s...</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>3285.0</td>\n </tr>\n <tr>\n <th>1</th>\n <td>Cumulative number of confirmed Ebola cases</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>2871.0</td>\n </tr>\n <tr>\n <th>2</th>\n <td>Cumulative number of probable Ebola cases</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>392.0</td>\n </tr>\n <tr>\n <th>3</th>\n <td>Cumulative number of suspected Ebola cases</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>22.0</td>\n </tr>\n <tr>\n <th>4</th>\n <td>Cumulative number of confirmed, probable and s...</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>2170.0</td>\n </tr>\n </tbody>\n</table>\n</div>" | |
}, | |
"execution_count": 46, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"indc.head()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 47, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.033351700Z", | |
"start_time": "2024-02-13T03:30:15.993993800Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": " Indicator Country Date \\\n0 Cumulative number of confirmed, probable and s... Guinea 2015-03-10 \n1 Cumulative number of confirmed Ebola cases Guinea 2015-03-10 \n2 Cumulative number of probable Ebola cases Guinea 2015-03-10 \n3 Cumulative number of suspected Ebola cases Guinea 2015-03-10 \n4 Cumulative number of confirmed, probable and s... Guinea 2015-03-10 \n5 Cumulative number of confirmed Ebola deaths Guinea 2015-03-10 \n6 Cumulative number of probable Ebola deaths Guinea 2015-03-10 \n\n value \n0 3285.0 \n1 2871.0 \n2 392.0 \n3 22.0 \n4 2170.0 \n5 1778.0 \n6 392.0 ", | |
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>Indicator</th>\n <th>Country</th>\n <th>Date</th>\n <th>value</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>Cumulative number of confirmed, probable and s...</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>3285.0</td>\n </tr>\n <tr>\n <th>1</th>\n <td>Cumulative number of confirmed Ebola cases</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>2871.0</td>\n </tr>\n <tr>\n <th>2</th>\n <td>Cumulative number of probable Ebola cases</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>392.0</td>\n </tr>\n <tr>\n <th>3</th>\n <td>Cumulative number of suspected Ebola cases</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>22.0</td>\n </tr>\n <tr>\n <th>4</th>\n <td>Cumulative number of confirmed, probable and s...</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>2170.0</td>\n </tr>\n <tr>\n <th>5</th>\n <td>Cumulative number of confirmed Ebola deaths</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>1778.0</td>\n </tr>\n <tr>\n <th>6</th>\n <td>Cumulative number of probable Ebola deaths</td>\n <td>Guinea</td>\n <td>2015-03-10</td>\n <td>392.0</td>\n </tr>\n </tbody>\n</table>\n</div>" | |
}, | |
"execution_count": 47, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"indc.head(n=7)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### What all columns do I have this dataframe?" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 48, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.074482500Z", | |
"start_time": "2024-02-13T03:30:16.019591300Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "['Indicator', 'Country', 'Date', 'value']" | |
}, | |
"execution_count": 48, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"list(indc)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### What are their datatypes?\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 49, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.167870100Z", | |
"start_time": "2024-02-13T03:30:16.045352400Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "Indicator object\nCountry object\nDate object\nvalue float64\ndtype: object" | |
}, | |
"execution_count": 49, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"indc.dtypes" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 50, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.318491800Z", | |
"start_time": "2024-02-13T03:30:16.107714900Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"ename": "KeyError", | |
"evalue": "'Year'", | |
"output_type": "error", | |
"traceback": [ | |
"\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", | |
"\u001B[1;31mKeyError\u001B[0m Traceback (most recent call last)", | |
"File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:3790\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m 3789\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[1;32m-> 3790\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_engine\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_loc\u001B[49m\u001B[43m(\u001B[49m\u001B[43mcasted_key\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 3791\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m err:\n", | |
"File \u001B[1;32mindex.pyx:152\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[1;34m()\u001B[0m\n", | |
"File \u001B[1;32mindex.pyx:181\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[1;34m()\u001B[0m\n", | |
"File \u001B[1;32mpandas\\_libs\\hashtable_class_helper.pxi:7080\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[1;34m()\u001B[0m\n", | |
"File \u001B[1;32mpandas\\_libs\\hashtable_class_helper.pxi:7088\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[1;34m()\u001B[0m\n", | |
"\u001B[1;31mKeyError\u001B[0m: 'Year'", | |
"\nThe above exception was the direct cause of the following exception:\n", | |
"\u001B[1;31mKeyError\u001B[0m Traceback (most recent call last)", | |
"Cell \u001B[1;32mIn[50], line 1\u001B[0m\n\u001B[1;32m----> 1\u001B[0m \u001B[43mindc\u001B[49m\u001B[43m[\u001B[49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mYear\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m]\u001B[49m\u001B[38;5;241m.\u001B[39mdtype \u001B[38;5;66;03m##for 1 column\u001B[39;00m\n", | |
"File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\core\\frame.py:3896\u001B[0m, in \u001B[0;36mDataFrame.__getitem__\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m 3894\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mnlevels \u001B[38;5;241m>\u001B[39m \u001B[38;5;241m1\u001B[39m:\n\u001B[0;32m 3895\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_getitem_multilevel(key)\n\u001B[1;32m-> 3896\u001B[0m indexer \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcolumns\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_loc\u001B[49m\u001B[43m(\u001B[49m\u001B[43mkey\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 3897\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m is_integer(indexer):\n\u001B[0;32m 3898\u001B[0m indexer \u001B[38;5;241m=\u001B[39m [indexer]\n", | |
"File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\pandas\\core\\indexes\\base.py:3797\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[1;34m(self, key)\u001B[0m\n\u001B[0;32m 3792\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(casted_key, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;129;01mor\u001B[39;00m (\n\u001B[0;32m 3793\u001B[0m \u001B[38;5;28misinstance\u001B[39m(casted_key, abc\u001B[38;5;241m.\u001B[39mIterable)\n\u001B[0;32m 3794\u001B[0m \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;28many\u001B[39m(\u001B[38;5;28misinstance\u001B[39m(x, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;28;01mfor\u001B[39;00m x \u001B[38;5;129;01min\u001B[39;00m casted_key)\n\u001B[0;32m 3795\u001B[0m ):\n\u001B[0;32m 3796\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m InvalidIndexError(key)\n\u001B[1;32m-> 3797\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m(key) \u001B[38;5;28;01mfrom\u001B[39;00m \u001B[38;5;21;01merr\u001B[39;00m\n\u001B[0;32m 3798\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mTypeError\u001B[39;00m:\n\u001B[0;32m 3799\u001B[0m \u001B[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001B[39;00m\n\u001B[0;32m 3800\u001B[0m \u001B[38;5;66;03m# InvalidIndexError. Otherwise we fall through and re-raise\u001B[39;00m\n\u001B[0;32m 3801\u001B[0m \u001B[38;5;66;03m# the TypeError.\u001B[39;00m\n\u001B[0;32m 3802\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_check_indexing_error(key)\n", | |
"\u001B[1;31mKeyError\u001B[0m: 'Year'" | |
] | |
} | |
], | |
"source": [ | |
"indc['Year'].dtype ##for 1 column" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 50, | |
"metadata": { | |
"collapsed": true, | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.393755900Z", | |
"start_time": "2024-02-13T03:30:16.266603500Z" | |
} | |
}, | |
"outputs": [], | |
"source": [] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 50, | |
"metadata": { | |
"collapsed": true, | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.494519300Z", | |
"start_time": "2024-02-13T03:30:16.397498500Z" | |
} | |
}, | |
"outputs": [], | |
"source": [] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 51, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.561617800Z", | |
"start_time": "2024-02-13T03:30:16.498242500Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": " value\ncount 17585.000000\nmean 955.857987\nstd 2313.569259\nmin 0.000000\n25% 0.000000\n50% 1.000000\n75% 287.000000\nmax 14122.000000", | |
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>value</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>count</th>\n <td>17585.000000</td>\n </tr>\n <tr>\n <th>mean</th>\n <td>955.857987</td>\n </tr>\n <tr>\n <th>std</th>\n <td>2313.569259</td>\n </tr>\n <tr>\n <th>min</th>\n <td>0.000000</td>\n </tr>\n <tr>\n <th>25%</th>\n <td>0.000000</td>\n </tr>\n <tr>\n <th>50%</th>\n <td>1.000000</td>\n </tr>\n <tr>\n <th>75%</th>\n <td>287.000000</td>\n </tr>\n <tr>\n <th>max</th>\n <td>14122.000000</td>\n </tr>\n </tbody>\n</table>\n</div>" | |
}, | |
"execution_count": 51, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"indc.describe() ## statistical summary of quantitative data columns" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### How many unique countries?" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 52, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.618989900Z", | |
"start_time": "2024-02-13T03:30:16.564124600Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"countries = indc['Country'].unique().tolist() ## list unique countries\n", | |
"## and produce list" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 53, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.694781200Z", | |
"start_time": "2024-02-13T03:30:16.599374600Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "['Guinea',\n 'Liberia',\n 'Sierra Leone',\n 'United Kingdom',\n 'Mali',\n 'Nigeria',\n 'Senegal',\n 'Spain',\n 'United States of America',\n 'Italy',\n 'Liberia 2',\n 'Guinea 2']" | |
}, | |
"execution_count": 53, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"countries" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 54, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.714781Z", | |
"start_time": "2024-02-13T03:30:16.679820500Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "array(['Guinea', 'Liberia', 'Sierra Leone', 'United Kingdom', 'Mali',\n 'Nigeria', 'Senegal', 'Spain', 'United States of America', 'Italy',\n 'Liberia 2', 'Guinea 2'], dtype=object)" | |
}, | |
"execution_count": 54, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"x=indc['Country'].unique()\n", | |
"x" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 55, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.801260100Z", | |
"start_time": "2024-02-13T03:30:16.719841400Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"12\n" | |
] | |
} | |
], | |
"source": [ | |
"print(len(countries)) ## how many countries " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 56, | |
"metadata": { | |
"collapsed": true, | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.847379Z", | |
"start_time": "2024-02-13T03:30:16.764575400Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"from collections import Counter" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 57, | |
"metadata": { | |
"collapsed": true, | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.858302100Z", | |
"start_time": "2024-02-13T03:30:16.851288700Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"c = Counter(countries)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 58, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.929660300Z", | |
"start_time": "2024-02-13T03:30:16.862297500Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Counter({'Guinea': 1, 'Liberia': 1, 'Sierra Leone': 1, 'United Kingdom': 1, 'Mali': 1, 'Nigeria': 1, 'Senegal': 1, 'Spain': 1, 'United States of America': 1, 'Italy': 1, 'Liberia 2': 1, 'Guinea 2': 1})\n" | |
] | |
} | |
], | |
"source": [ | |
"print(c)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 59, | |
"metadata": { | |
"collapsed": true, | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.933659300Z", | |
"start_time": "2024-02-13T03:30:16.910079800Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"ccode = indc['Country'].tolist() ## just list all country codes" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 60, | |
"metadata": { | |
"collapsed": true, | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.967520500Z", | |
"start_time": "2024-02-13T03:30:16.939485800Z" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"cc = Counter(ccode)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 61, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:16.987109800Z", | |
"start_time": "2024-02-13T03:30:16.973881400Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Counter({'Sierra Leone': 2303, 'Nigeria': 2124, 'Guinea': 2086, 'Senegal': 2081, 'United States of America': 1932, 'Spain': 1924, 'Liberia': 1540, 'Mali': 1234, 'United Kingdom': 1107, 'Italy': 708, 'Liberia 2': 536, 'Guinea 2': 10})\n" | |
] | |
} | |
], | |
"source": [ | |
"print(cc)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 62, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:17.037808800Z", | |
"start_time": "2024-02-13T03:30:16.992366900Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[('Sierra Leone', 2303)]\n" | |
] | |
} | |
], | |
"source": [ | |
"print(cc.most_common(1)) ## most common country code" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 63, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:17.054832900Z", | |
"start_time": "2024-02-13T03:30:16.996370900Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[('Sierra Leone', 2303), ('Nigeria', 2124)]\n" | |
] | |
} | |
], | |
"source": [ | |
"print(cc.most_common(2))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 64, | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2024-02-13T03:30:17.066470500Z", | |
"start_time": "2024-02-13T03:30:17.041810300Z" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"0 Cumulative number of confirmed, probable and s...\n", | |
"1 Cumulative number of confirmed Ebola cases\n", | |
"2 Cumulative number of probable Ebola cases\n", | |
"3 Cumulative number of suspected Ebola cases\n", | |
"4 Cumulative number of confirmed, probable and s...\n", | |
"5 Cumulative number of confirmed Ebola deaths\n", | |
"6 Cumulative number of probable Ebola deaths\n", | |
"7 Cumulative number of confirmed, probable and s...\n", | |
"8 Cumulative number of confirmed Ebola cases\n", | |
"9 Cumulative number of probable Ebola cases\n", | |
"10 Cumulative number of suspected Ebola cases\n", | |
"11 Cumulative number of confirmed, probable and s...\n", | |
"12 Cumulative number of confirmed, probable and s...\n", | |
"13 Cumulative number of confirmed Ebola cases\n", | |
"14 Cumulative number of probable Ebola cases\n", | |
"15 Cumulative number of suspected Ebola cases\n", | |
"16 Cumulative number of confirmed, probable and s...\n", | |
"17 Cumulative number of confirmed Ebola deaths\n", | |
"18 Cumulative number of probable Ebola deaths\n", | |
"19 Cumulative number of suspected Ebola deaths\n", | |
"Name: Indicator, dtype: object\n" | |
] | |
} | |
], | |
"source": [ | |
"print(indc['Indicator'][:20]) ## top 20 indicators" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.8.8" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
invalid notebook wak