Skip to content

Instantly share code, notes, and snippets.

@v--
Last active March 13, 2023 14:14
Show Gist options
  • Save v--/994352cadfbab85f2f693404198a8805 to your computer and use it in GitHub Desktop.
Save v--/994352cadfbab85f2f693404198a8805 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"id": "6b8864fc-ea2c-4006-8e9a-2a4c0ee959e1",
"metadata": {},
"source": [
"### Retrieve startup count data"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "29a39ea4-3c5b-4f78-b536-32c6503dfb94",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"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>iso2</th>\n",
" <th>name</th>\n",
" <th>startup_count</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>US</td>\n",
" <td>United States</td>\n",
" <td>77077</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>IN</td>\n",
" <td>India</td>\n",
" <td>16940</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>GB</td>\n",
" <td>United Kingdom</td>\n",
" <td>6990</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>CA</td>\n",
" <td>Canada</td>\n",
" <td>3875</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>AU</td>\n",
" <td>Australia</td>\n",
" <td>2871</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" iso2 name startup_count\n",
"0 US United States 77077\n",
"1 IN India 16940\n",
"2 GB United Kingdom 6990\n",
"3 CA Canada 3875\n",
"4 AU Australia 2871"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import json\n",
"import pandas as pd\n",
"import pycountry\n",
"import requests\n",
"from bs4 import BeautifulSoup\n",
"\n",
"\n",
"# Manually downloaded from https://www.startupranking.com/countries because of CloudFlare protection\n",
"with open('https __www.startupranking.com_countries.html') as file:\n",
" sr_bs = BeautifulSoup(file.read())\n",
" \n",
"sr_countries_tag = sr_bs.find_all(type='81a414b0870adeacef91523f-text/javascript')[16]\n",
"sr_countries = json.loads(sr_countries_tag.text[25:-6])\n",
"sr_df = pd.DataFrame(sr_countries['data'])[['code', 'name', 'value']] \\\n",
" .rename(columns=dict(code='iso2', value='startup_count'))\n",
"\n",
"sr_df.head()"
]
},
{
"cell_type": "markdown",
"id": "bd97d149-bf1a-4451-83fa-f33acdf68852",
"metadata": {},
"source": [
"### Retrieve population data"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "2f3eba8a-69d7-4c02-8205-0c86a9f0ca43",
"metadata": {},
"outputs": [
{
"data": {
"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>iso2</th>\n",
" <th>population</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>AF</td>\n",
" <td>37172386</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>AL</td>\n",
" <td>2866376</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>DZ</td>\n",
" <td>42228429</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>AS</td>\n",
" <td>55465</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>AD</td>\n",
" <td>77006</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" iso2 population\n",
"0 AF 37172386\n",
"1 AL 2866376\n",
"2 DZ 42228429\n",
"3 AS 55465\n",
"4 AD 77006"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import requests\n",
"\n",
"pop_res = requests.get('https://countriesnow.space/api/v0.1/countries/population')\n",
"pop_json = pop_res.json()['data']\n",
"pop_df = pd.DataFrame([\n",
" dict(\n",
" iso2=pycountry.countries.get(alpha_3=row['iso3']).alpha_2,\n",
" population=row['populationCounts'][-1]['value']\n",
" )\n",
" for row in pop_json\n",
" if pycountry.countries.get(alpha_3=row['iso3'])\n",
"])\n",
"\n",
"pop_df.head()"
]
},
{
"cell_type": "markdown",
"id": "4d297932-42bc-4f00-bca8-760dd355524c",
"metadata": {
"tags": []
},
"source": [
"### Show countries by the number of startups per capita (only countries with >=1 million population)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "6e2c4b07-aa91-4252-a2ba-5a56c21183d4",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"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>iso2</th>\n",
" <th>name</th>\n",
" <th>startup_count</th>\n",
" <th>population</th>\n",
" <th>startups_per_capita</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>US</td>\n",
" <td>United States</td>\n",
" <td>77077</td>\n",
" <td>326687501</td>\n",
" <td>0.000236</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>EE</td>\n",
" <td>Estonia</td>\n",
" <td>270</td>\n",
" <td>1321977</td>\n",
" <td>0.000204</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>SG</td>\n",
" <td>Singapore</td>\n",
" <td>1117</td>\n",
" <td>5638676</td>\n",
" <td>0.000198</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>AE</td>\n",
" <td>United Arab Emirates</td>\n",
" <td>1146</td>\n",
" <td>9630959</td>\n",
" <td>0.000119</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>AU</td>\n",
" <td>Australia</td>\n",
" <td>2871</td>\n",
" <td>24982688</td>\n",
" <td>0.000115</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>IL</td>\n",
" <td>Israel</td>\n",
" <td>985</td>\n",
" <td>8882800</td>\n",
" <td>0.000111</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>GB</td>\n",
" <td>United Kingdom</td>\n",
" <td>6990</td>\n",
" <td>66460344</td>\n",
" <td>0.000105</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>CA</td>\n",
" <td>Canada</td>\n",
" <td>3875</td>\n",
" <td>37057765</td>\n",
" <td>0.000105</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>IE</td>\n",
" <td>Ireland</td>\n",
" <td>462</td>\n",
" <td>4867309</td>\n",
" <td>0.000095</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>CH</td>\n",
" <td>Switzerland</td>\n",
" <td>786</td>\n",
" <td>8513227</td>\n",
" <td>0.000092</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>FI</td>\n",
" <td>Finland</td>\n",
" <td>467</td>\n",
" <td>5515525</td>\n",
" <td>0.000085</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>DK</td>\n",
" <td>Denmark</td>\n",
" <td>424</td>\n",
" <td>5793636</td>\n",
" <td>0.000073</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>SE</td>\n",
" <td>Sweden</td>\n",
" <td>723</td>\n",
" <td>10175214</td>\n",
" <td>0.000071</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>CY</td>\n",
" <td>Cyprus</td>\n",
" <td>81</td>\n",
" <td>1189265</td>\n",
" <td>0.000068</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>LT</td>\n",
" <td>Lithuania</td>\n",
" <td>176</td>\n",
" <td>2801543</td>\n",
" <td>0.000063</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>NL</td>\n",
" <td>Netherlands</td>\n",
" <td>1074</td>\n",
" <td>17231624</td>\n",
" <td>0.000062</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>NO</td>\n",
" <td>Norway</td>\n",
" <td>321</td>\n",
" <td>5311916</td>\n",
" <td>0.000060</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>NZ</td>\n",
" <td>New Zealand</td>\n",
" <td>279</td>\n",
" <td>4841000</td>\n",
" <td>0.000058</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>HK</td>\n",
" <td>Hong Kong SAR China</td>\n",
" <td>404</td>\n",
" <td>7451000</td>\n",
" <td>0.000054</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>BE</td>\n",
" <td>Belgium</td>\n",
" <td>603</td>\n",
" <td>11433256</td>\n",
" <td>0.000053</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>LV</td>\n",
" <td>Latvia</td>\n",
" <td>97</td>\n",
" <td>1927174</td>\n",
" <td>0.000050</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>SI</td>\n",
" <td>Slovenia</td>\n",
" <td>87</td>\n",
" <td>2073894</td>\n",
" <td>0.000042</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>PT</td>\n",
" <td>Portugal</td>\n",
" <td>389</td>\n",
" <td>10283822</td>\n",
" <td>0.000038</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>AT</td>\n",
" <td>Austria</td>\n",
" <td>316</td>\n",
" <td>8840521</td>\n",
" <td>0.000036</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>AL</td>\n",
" <td>Albania</td>\n",
" <td>93</td>\n",
" <td>2866376</td>\n",
" <td>0.000032</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>HU</td>\n",
" <td>Hungary</td>\n",
" <td>311</td>\n",
" <td>9775564</td>\n",
" <td>0.000032</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>ES</td>\n",
" <td>Spain</td>\n",
" <td>1457</td>\n",
" <td>46796540</td>\n",
" <td>0.000031</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>DE</td>\n",
" <td>Germany</td>\n",
" <td>2412</td>\n",
" <td>82905782</td>\n",
" <td>0.000029</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>MU</td>\n",
" <td>Mauritius</td>\n",
" <td>34</td>\n",
" <td>1265303</td>\n",
" <td>0.000027</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>HR</td>\n",
" <td>Croatia</td>\n",
" <td>106</td>\n",
" <td>4087843</td>\n",
" <td>0.000026</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>FR</td>\n",
" <td>France</td>\n",
" <td>1605</td>\n",
" <td>66977107</td>\n",
" <td>0.000024</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>UY</td>\n",
" <td>Uruguay</td>\n",
" <td>78</td>\n",
" <td>3449299</td>\n",
" <td>0.000023</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>AZ</td>\n",
" <td>Azerbaijan</td>\n",
" <td>221</td>\n",
" <td>9939800</td>\n",
" <td>0.000022</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>PE</td>\n",
" <td>Peru</td>\n",
" <td>695</td>\n",
" <td>31989256</td>\n",
" <td>0.000022</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>BG</td>\n",
" <td>Bulgaria</td>\n",
" <td>151</td>\n",
" <td>7025037</td>\n",
" <td>0.000021</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>CL</td>\n",
" <td>Chile</td>\n",
" <td>385</td>\n",
" <td>18729160</td>\n",
" <td>0.000021</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>LK</td>\n",
" <td>Sri Lanka</td>\n",
" <td>409</td>\n",
" <td>21670000</td>\n",
" <td>0.000019</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>BH</td>\n",
" <td>Bahrain</td>\n",
" <td>27</td>\n",
" <td>1569439</td>\n",
" <td>0.000017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>BW</td>\n",
" <td>Botswana</td>\n",
" <td>38</td>\n",
" <td>2254126</td>\n",
" <td>0.000017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>40</th>\n",
" <td>GR</td>\n",
" <td>Greece</td>\n",
" <td>174</td>\n",
" <td>10731726</td>\n",
" <td>0.000016</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>IT</td>\n",
" <td>Italy</td>\n",
" <td>955</td>\n",
" <td>60421760</td>\n",
" <td>0.000016</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>SK</td>\n",
" <td>Slovakia</td>\n",
" <td>80</td>\n",
" <td>5446771</td>\n",
" <td>0.000015</td>\n",
" </tr>\n",
" <tr>\n",
" <th>43</th>\n",
" <td>CZ</td>\n",
" <td>Czech Republic</td>\n",
" <td>153</td>\n",
" <td>10629928</td>\n",
" <td>0.000014</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44</th>\n",
" <td>RO</td>\n",
" <td>Romania</td>\n",
" <td>267</td>\n",
" <td>19466145</td>\n",
" <td>0.000014</td>\n",
" </tr>\n",
" <tr>\n",
" <th>45</th>\n",
" <td>PL</td>\n",
" <td>Poland</td>\n",
" <td>506</td>\n",
" <td>37974750</td>\n",
" <td>0.000013</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46</th>\n",
" <td>RS</td>\n",
" <td>Serbia</td>\n",
" <td>91</td>\n",
" <td>6982604</td>\n",
" <td>0.000013</td>\n",
" </tr>\n",
" <tr>\n",
" <th>47</th>\n",
" <td>IN</td>\n",
" <td>India</td>\n",
" <td>16940</td>\n",
" <td>1352617328</td>\n",
" <td>0.000013</td>\n",
" </tr>\n",
" <tr>\n",
" <th>48</th>\n",
" <td>QA</td>\n",
" <td>Qatar</td>\n",
" <td>33</td>\n",
" <td>2781677</td>\n",
" <td>0.000012</td>\n",
" </tr>\n",
" <tr>\n",
" <th>49</th>\n",
" <td>KW</td>\n",
" <td>Kuwait</td>\n",
" <td>48</td>\n",
" <td>4137309</td>\n",
" <td>0.000012</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50</th>\n",
" <td>CO</td>\n",
" <td>Colombia</td>\n",
" <td>527</td>\n",
" <td>49648685</td>\n",
" <td>0.000011</td>\n",
" </tr>\n",
" <tr>\n",
" <th>51</th>\n",
" <td>MY</td>\n",
" <td>Malaysia</td>\n",
" <td>326</td>\n",
" <td>31528585</td>\n",
" <td>0.000010</td>\n",
" </tr>\n",
" <tr>\n",
" <th>52</th>\n",
" <td>AR</td>\n",
" <td>Argentina</td>\n",
" <td>446</td>\n",
" <td>44494502</td>\n",
" <td>0.000010</td>\n",
" </tr>\n",
" <tr>\n",
" <th>53</th>\n",
" <td>ID</td>\n",
" <td>Indonesia</td>\n",
" <td>2499</td>\n",
" <td>267663435</td>\n",
" <td>0.000009</td>\n",
" </tr>\n",
" <tr>\n",
" <th>54</th>\n",
" <td>JO</td>\n",
" <td>Jordan</td>\n",
" <td>91</td>\n",
" <td>9956011</td>\n",
" <td>0.000009</td>\n",
" </tr>\n",
" <tr>\n",
" <th>55</th>\n",
" <td>PA</td>\n",
" <td>Panama</td>\n",
" <td>37</td>\n",
" <td>4176873</td>\n",
" <td>0.000009</td>\n",
" </tr>\n",
" <tr>\n",
" <th>56</th>\n",
" <td>ZA</td>\n",
" <td>South Africa</td>\n",
" <td>499</td>\n",
" <td>57779622</td>\n",
" <td>0.000009</td>\n",
" </tr>\n",
" <tr>\n",
" <th>57</th>\n",
" <td>UA</td>\n",
" <td>Ukraine</td>\n",
" <td>363</td>\n",
" <td>44622516</td>\n",
" <td>0.000008</td>\n",
" </tr>\n",
" <tr>\n",
" <th>58</th>\n",
" <td>BY</td>\n",
" <td>Belarus</td>\n",
" <td>74</td>\n",
" <td>9483499</td>\n",
" <td>0.000008</td>\n",
" </tr>\n",
" <tr>\n",
" <th>59</th>\n",
" <td>TR</td>\n",
" <td>Turkey</td>\n",
" <td>585</td>\n",
" <td>82319724</td>\n",
" <td>0.000007</td>\n",
" </tr>\n",
" <tr>\n",
" <th>60</th>\n",
" <td>LB</td>\n",
" <td>Lebanon</td>\n",
" <td>48</td>\n",
" <td>6848925</td>\n",
" <td>0.000007</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" iso2 name startup_count population startups_per_capita\n",
"1 US United States 77077 326687501 0.000236\n",
"2 EE Estonia 270 1321977 0.000204\n",
"3 SG Singapore 1117 5638676 0.000198\n",
"4 AE United Arab Emirates 1146 9630959 0.000119\n",
"5 AU Australia 2871 24982688 0.000115\n",
"6 IL Israel 985 8882800 0.000111\n",
"7 GB United Kingdom 6990 66460344 0.000105\n",
"8 CA Canada 3875 37057765 0.000105\n",
"9 IE Ireland 462 4867309 0.000095\n",
"10 CH Switzerland 786 8513227 0.000092\n",
"11 FI Finland 467 5515525 0.000085\n",
"12 DK Denmark 424 5793636 0.000073\n",
"13 SE Sweden 723 10175214 0.000071\n",
"14 CY Cyprus 81 1189265 0.000068\n",
"15 LT Lithuania 176 2801543 0.000063\n",
"16 NL Netherlands 1074 17231624 0.000062\n",
"17 NO Norway 321 5311916 0.000060\n",
"18 NZ New Zealand 279 4841000 0.000058\n",
"19 HK Hong Kong SAR China 404 7451000 0.000054\n",
"20 BE Belgium 603 11433256 0.000053\n",
"21 LV Latvia 97 1927174 0.000050\n",
"22 SI Slovenia 87 2073894 0.000042\n",
"23 PT Portugal 389 10283822 0.000038\n",
"24 AT Austria 316 8840521 0.000036\n",
"25 AL Albania 93 2866376 0.000032\n",
"26 HU Hungary 311 9775564 0.000032\n",
"27 ES Spain 1457 46796540 0.000031\n",
"28 DE Germany 2412 82905782 0.000029\n",
"29 MU Mauritius 34 1265303 0.000027\n",
"30 HR Croatia 106 4087843 0.000026\n",
"31 FR France 1605 66977107 0.000024\n",
"32 UY Uruguay 78 3449299 0.000023\n",
"33 AZ Azerbaijan 221 9939800 0.000022\n",
"34 PE Peru 695 31989256 0.000022\n",
"35 BG Bulgaria 151 7025037 0.000021\n",
"36 CL Chile 385 18729160 0.000021\n",
"37 LK Sri Lanka 409 21670000 0.000019\n",
"38 BH Bahrain 27 1569439 0.000017\n",
"39 BW Botswana 38 2254126 0.000017\n",
"40 GR Greece 174 10731726 0.000016\n",
"41 IT Italy 955 60421760 0.000016\n",
"42 SK Slovakia 80 5446771 0.000015\n",
"43 CZ Czech Republic 153 10629928 0.000014\n",
"44 RO Romania 267 19466145 0.000014\n",
"45 PL Poland 506 37974750 0.000013\n",
"46 RS Serbia 91 6982604 0.000013\n",
"47 IN India 16940 1352617328 0.000013\n",
"48 QA Qatar 33 2781677 0.000012\n",
"49 KW Kuwait 48 4137309 0.000012\n",
"50 CO Colombia 527 49648685 0.000011\n",
"51 MY Malaysia 326 31528585 0.000010\n",
"52 AR Argentina 446 44494502 0.000010\n",
"53 ID Indonesia 2499 267663435 0.000009\n",
"54 JO Jordan 91 9956011 0.000009\n",
"55 PA Panama 37 4176873 0.000009\n",
"56 ZA South Africa 499 57779622 0.000009\n",
"57 UA Ukraine 363 44622516 0.000008\n",
"58 BY Belarus 74 9483499 0.000008\n",
"59 TR Turkey 585 82319724 0.000007\n",
"60 LB Lebanon 48 6848925 0.000007"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_full = sr_df.set_index('iso2').join(pop_df.set_index('iso2'), how='inner').reset_index()\n",
"df_full['startups_per_capita'] = df_full['startup_count'] / df_full['population']\n",
"\n",
"large_countries = df_full[df_full['population'] >= 1e6]\n",
"per_capita = large_countries.sort_values('startups_per_capita', ascending=False, ignore_index=True).head(60)\n",
"per_capita.index += 1\n",
"per_capita"
]
},
{
"cell_type": "markdown",
"id": "0103c25c-9cb6-450e-9b23-9c6fc3367f3c",
"metadata": {},
"source": [
"### Show countries by the number of startups per capita (all countries)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "f4263f41-d9b7-43a2-bda4-0c007b1c8a93",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"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>iso2</th>\n",
" <th>name</th>\n",
" <th>startup_count</th>\n",
" <th>population</th>\n",
" <th>startups_per_capita</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>AS</td>\n",
" <td>American Samoa</td>\n",
" <td>51</td>\n",
" <td>55465</td>\n",
" <td>0.000919</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>VG</td>\n",
" <td>British Virgin Islands</td>\n",
" <td>11</td>\n",
" <td>29802</td>\n",
" <td>0.000369</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>KY</td>\n",
" <td>Cayman Islands</td>\n",
" <td>21</td>\n",
" <td>64174</td>\n",
" <td>0.000327</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>BM</td>\n",
" <td>Bermuda</td>\n",
" <td>20</td>\n",
" <td>63973</td>\n",
" <td>0.000313</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>AD</td>\n",
" <td>Andorra</td>\n",
" <td>22</td>\n",
" <td>77006</td>\n",
" <td>0.000286</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>GI</td>\n",
" <td>Gibraltar</td>\n",
" <td>8</td>\n",
" <td>33718</td>\n",
" <td>0.000237</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>US</td>\n",
" <td>United States</td>\n",
" <td>77077</td>\n",
" <td>326687501</td>\n",
" <td>0.000236</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>EE</td>\n",
" <td>Estonia</td>\n",
" <td>270</td>\n",
" <td>1321977</td>\n",
" <td>0.000204</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>SG</td>\n",
" <td>Singapore</td>\n",
" <td>1117</td>\n",
" <td>5638676</td>\n",
" <td>0.000198</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>LI</td>\n",
" <td>Liechtenstein</td>\n",
" <td>7</td>\n",
" <td>37910</td>\n",
" <td>0.000185</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>LU</td>\n",
" <td>Luxembourg</td>\n",
" <td>77</td>\n",
" <td>607950</td>\n",
" <td>0.000127</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>AE</td>\n",
" <td>United Arab Emirates</td>\n",
" <td>1146</td>\n",
" <td>9630959</td>\n",
" <td>0.000119</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>AU</td>\n",
" <td>Australia</td>\n",
" <td>2871</td>\n",
" <td>24982688</td>\n",
" <td>0.000115</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>IL</td>\n",
" <td>Israel</td>\n",
" <td>985</td>\n",
" <td>8882800</td>\n",
" <td>0.000111</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>GB</td>\n",
" <td>United Kingdom</td>\n",
" <td>6990</td>\n",
" <td>66460344</td>\n",
" <td>0.000105</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>CA</td>\n",
" <td>Canada</td>\n",
" <td>3875</td>\n",
" <td>37057765</td>\n",
" <td>0.000105</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>SC</td>\n",
" <td>Seychelles</td>\n",
" <td>10</td>\n",
" <td>96762</td>\n",
" <td>0.000103</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>MT</td>\n",
" <td>Malta</td>\n",
" <td>47</td>\n",
" <td>484630</td>\n",
" <td>0.000097</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>IM</td>\n",
" <td>Isle of Man</td>\n",
" <td>8</td>\n",
" <td>84077</td>\n",
" <td>0.000095</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>IE</td>\n",
" <td>Ireland</td>\n",
" <td>462</td>\n",
" <td>4867309</td>\n",
" <td>0.000095</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>CH</td>\n",
" <td>Switzerland</td>\n",
" <td>786</td>\n",
" <td>8513227</td>\n",
" <td>0.000092</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>FI</td>\n",
" <td>Finland</td>\n",
" <td>467</td>\n",
" <td>5515525</td>\n",
" <td>0.000085</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>MC</td>\n",
" <td>Monaco</td>\n",
" <td>3</td>\n",
" <td>38682</td>\n",
" <td>0.000078</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>DK</td>\n",
" <td>Denmark</td>\n",
" <td>424</td>\n",
" <td>5793636</td>\n",
" <td>0.000073</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>SE</td>\n",
" <td>Sweden</td>\n",
" <td>723</td>\n",
" <td>10175214</td>\n",
" <td>0.000071</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>CY</td>\n",
" <td>Cyprus</td>\n",
" <td>81</td>\n",
" <td>1189265</td>\n",
" <td>0.000068</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>IS</td>\n",
" <td>Iceland</td>\n",
" <td>24</td>\n",
" <td>352721</td>\n",
" <td>0.000068</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>VI</td>\n",
" <td>U.S. Virgin Islands</td>\n",
" <td>7</td>\n",
" <td>106977</td>\n",
" <td>0.000065</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>LT</td>\n",
" <td>Lithuania</td>\n",
" <td>176</td>\n",
" <td>2801543</td>\n",
" <td>0.000063</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>NL</td>\n",
" <td>Netherlands</td>\n",
" <td>1074</td>\n",
" <td>17231624</td>\n",
" <td>0.000062</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>AG</td>\n",
" <td>Antigua &amp; Barbuda</td>\n",
" <td>6</td>\n",
" <td>96286</td>\n",
" <td>0.000062</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>NO</td>\n",
" <td>Norway</td>\n",
" <td>321</td>\n",
" <td>5311916</td>\n",
" <td>0.000060</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>NZ</td>\n",
" <td>New Zealand</td>\n",
" <td>279</td>\n",
" <td>4841000</td>\n",
" <td>0.000058</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>KN</td>\n",
" <td>St. Kitts &amp; Nevis</td>\n",
" <td>3</td>\n",
" <td>52441</td>\n",
" <td>0.000057</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>HK</td>\n",
" <td>Hong Kong SAR China</td>\n",
" <td>404</td>\n",
" <td>7451000</td>\n",
" <td>0.000054</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>BE</td>\n",
" <td>Belgium</td>\n",
" <td>603</td>\n",
" <td>11433256</td>\n",
" <td>0.000053</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>MH</td>\n",
" <td>Marshall Islands</td>\n",
" <td>3</td>\n",
" <td>58413</td>\n",
" <td>0.000051</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>LV</td>\n",
" <td>Latvia</td>\n",
" <td>97</td>\n",
" <td>1927174</td>\n",
" <td>0.000050</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>SI</td>\n",
" <td>Slovenia</td>\n",
" <td>87</td>\n",
" <td>2073894</td>\n",
" <td>0.000042</td>\n",
" </tr>\n",
" <tr>\n",
" <th>40</th>\n",
" <td>BZ</td>\n",
" <td>Belize</td>\n",
" <td>15</td>\n",
" <td>383071</td>\n",
" <td>0.000039</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>PT</td>\n",
" <td>Portugal</td>\n",
" <td>389</td>\n",
" <td>10283822</td>\n",
" <td>0.000038</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>AT</td>\n",
" <td>Austria</td>\n",
" <td>316</td>\n",
" <td>8840521</td>\n",
" <td>0.000036</td>\n",
" </tr>\n",
" <tr>\n",
" <th>43</th>\n",
" <td>AL</td>\n",
" <td>Albania</td>\n",
" <td>93</td>\n",
" <td>2866376</td>\n",
" <td>0.000032</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44</th>\n",
" <td>HU</td>\n",
" <td>Hungary</td>\n",
" <td>311</td>\n",
" <td>9775564</td>\n",
" <td>0.000032</td>\n",
" </tr>\n",
" <tr>\n",
" <th>45</th>\n",
" <td>ES</td>\n",
" <td>Spain</td>\n",
" <td>1457</td>\n",
" <td>46796540</td>\n",
" <td>0.000031</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46</th>\n",
" <td>SM</td>\n",
" <td>San Marino</td>\n",
" <td>1</td>\n",
" <td>33785</td>\n",
" <td>0.000030</td>\n",
" </tr>\n",
" <tr>\n",
" <th>47</th>\n",
" <td>DE</td>\n",
" <td>Germany</td>\n",
" <td>2412</td>\n",
" <td>82905782</td>\n",
" <td>0.000029</td>\n",
" </tr>\n",
" <tr>\n",
" <th>48</th>\n",
" <td>MU</td>\n",
" <td>Mauritius</td>\n",
" <td>34</td>\n",
" <td>1265303</td>\n",
" <td>0.000027</td>\n",
" </tr>\n",
" <tr>\n",
" <th>49</th>\n",
" <td>TC</td>\n",
" <td>Turks &amp; Caicos Islands</td>\n",
" <td>1</td>\n",
" <td>37665</td>\n",
" <td>0.000027</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50</th>\n",
" <td>HR</td>\n",
" <td>Croatia</td>\n",
" <td>106</td>\n",
" <td>4087843</td>\n",
" <td>0.000026</td>\n",
" </tr>\n",
" <tr>\n",
" <th>51</th>\n",
" <td>FR</td>\n",
" <td>France</td>\n",
" <td>1605</td>\n",
" <td>66977107</td>\n",
" <td>0.000024</td>\n",
" </tr>\n",
" <tr>\n",
" <th>52</th>\n",
" <td>UY</td>\n",
" <td>Uruguay</td>\n",
" <td>78</td>\n",
" <td>3449299</td>\n",
" <td>0.000023</td>\n",
" </tr>\n",
" <tr>\n",
" <th>53</th>\n",
" <td>AZ</td>\n",
" <td>Azerbaijan</td>\n",
" <td>221</td>\n",
" <td>9939800</td>\n",
" <td>0.000022</td>\n",
" </tr>\n",
" <tr>\n",
" <th>54</th>\n",
" <td>LC</td>\n",
" <td>St. Lucia</td>\n",
" <td>4</td>\n",
" <td>181889</td>\n",
" <td>0.000022</td>\n",
" </tr>\n",
" <tr>\n",
" <th>55</th>\n",
" <td>PE</td>\n",
" <td>Peru</td>\n",
" <td>695</td>\n",
" <td>31989256</td>\n",
" <td>0.000022</td>\n",
" </tr>\n",
" <tr>\n",
" <th>56</th>\n",
" <td>BG</td>\n",
" <td>Bulgaria</td>\n",
" <td>151</td>\n",
" <td>7025037</td>\n",
" <td>0.000021</td>\n",
" </tr>\n",
" <tr>\n",
" <th>57</th>\n",
" <td>BN</td>\n",
" <td>Brunei</td>\n",
" <td>9</td>\n",
" <td>428962</td>\n",
" <td>0.000021</td>\n",
" </tr>\n",
" <tr>\n",
" <th>58</th>\n",
" <td>FO</td>\n",
" <td>Faroe Islands</td>\n",
" <td>1</td>\n",
" <td>48497</td>\n",
" <td>0.000021</td>\n",
" </tr>\n",
" <tr>\n",
" <th>59</th>\n",
" <td>CL</td>\n",
" <td>Chile</td>\n",
" <td>385</td>\n",
" <td>18729160</td>\n",
" <td>0.000021</td>\n",
" </tr>\n",
" <tr>\n",
" <th>60</th>\n",
" <td>LK</td>\n",
" <td>Sri Lanka</td>\n",
" <td>409</td>\n",
" <td>21670000</td>\n",
" <td>0.000019</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" iso2 name startup_count population \\\n",
"1 AS American Samoa 51 55465 \n",
"2 VG British Virgin Islands 11 29802 \n",
"3 KY Cayman Islands 21 64174 \n",
"4 BM Bermuda 20 63973 \n",
"5 AD Andorra 22 77006 \n",
"6 GI Gibraltar 8 33718 \n",
"7 US United States 77077 326687501 \n",
"8 EE Estonia 270 1321977 \n",
"9 SG Singapore 1117 5638676 \n",
"10 LI Liechtenstein 7 37910 \n",
"11 LU Luxembourg 77 607950 \n",
"12 AE United Arab Emirates 1146 9630959 \n",
"13 AU Australia 2871 24982688 \n",
"14 IL Israel 985 8882800 \n",
"15 GB United Kingdom 6990 66460344 \n",
"16 CA Canada 3875 37057765 \n",
"17 SC Seychelles 10 96762 \n",
"18 MT Malta 47 484630 \n",
"19 IM Isle of Man 8 84077 \n",
"20 IE Ireland 462 4867309 \n",
"21 CH Switzerland 786 8513227 \n",
"22 FI Finland 467 5515525 \n",
"23 MC Monaco 3 38682 \n",
"24 DK Denmark 424 5793636 \n",
"25 SE Sweden 723 10175214 \n",
"26 CY Cyprus 81 1189265 \n",
"27 IS Iceland 24 352721 \n",
"28 VI U.S. Virgin Islands 7 106977 \n",
"29 LT Lithuania 176 2801543 \n",
"30 NL Netherlands 1074 17231624 \n",
"31 AG Antigua & Barbuda 6 96286 \n",
"32 NO Norway 321 5311916 \n",
"33 NZ New Zealand 279 4841000 \n",
"34 KN St. Kitts & Nevis 3 52441 \n",
"35 HK Hong Kong SAR China 404 7451000 \n",
"36 BE Belgium 603 11433256 \n",
"37 MH Marshall Islands 3 58413 \n",
"38 LV Latvia 97 1927174 \n",
"39 SI Slovenia 87 2073894 \n",
"40 BZ Belize 15 383071 \n",
"41 PT Portugal 389 10283822 \n",
"42 AT Austria 316 8840521 \n",
"43 AL Albania 93 2866376 \n",
"44 HU Hungary 311 9775564 \n",
"45 ES Spain 1457 46796540 \n",
"46 SM San Marino 1 33785 \n",
"47 DE Germany 2412 82905782 \n",
"48 MU Mauritius 34 1265303 \n",
"49 TC Turks & Caicos Islands 1 37665 \n",
"50 HR Croatia 106 4087843 \n",
"51 FR France 1605 66977107 \n",
"52 UY Uruguay 78 3449299 \n",
"53 AZ Azerbaijan 221 9939800 \n",
"54 LC St. Lucia 4 181889 \n",
"55 PE Peru 695 31989256 \n",
"56 BG Bulgaria 151 7025037 \n",
"57 BN Brunei 9 428962 \n",
"58 FO Faroe Islands 1 48497 \n",
"59 CL Chile 385 18729160 \n",
"60 LK Sri Lanka 409 21670000 \n",
"\n",
" startups_per_capita \n",
"1 0.000919 \n",
"2 0.000369 \n",
"3 0.000327 \n",
"4 0.000313 \n",
"5 0.000286 \n",
"6 0.000237 \n",
"7 0.000236 \n",
"8 0.000204 \n",
"9 0.000198 \n",
"10 0.000185 \n",
"11 0.000127 \n",
"12 0.000119 \n",
"13 0.000115 \n",
"14 0.000111 \n",
"15 0.000105 \n",
"16 0.000105 \n",
"17 0.000103 \n",
"18 0.000097 \n",
"19 0.000095 \n",
"20 0.000095 \n",
"21 0.000092 \n",
"22 0.000085 \n",
"23 0.000078 \n",
"24 0.000073 \n",
"25 0.000071 \n",
"26 0.000068 \n",
"27 0.000068 \n",
"28 0.000065 \n",
"29 0.000063 \n",
"30 0.000062 \n",
"31 0.000062 \n",
"32 0.000060 \n",
"33 0.000058 \n",
"34 0.000057 \n",
"35 0.000054 \n",
"36 0.000053 \n",
"37 0.000051 \n",
"38 0.000050 \n",
"39 0.000042 \n",
"40 0.000039 \n",
"41 0.000038 \n",
"42 0.000036 \n",
"43 0.000032 \n",
"44 0.000032 \n",
"45 0.000031 \n",
"46 0.000030 \n",
"47 0.000029 \n",
"48 0.000027 \n",
"49 0.000027 \n",
"50 0.000026 \n",
"51 0.000024 \n",
"52 0.000023 \n",
"53 0.000022 \n",
"54 0.000022 \n",
"55 0.000022 \n",
"56 0.000021 \n",
"57 0.000021 \n",
"58 0.000021 \n",
"59 0.000021 \n",
"60 0.000019 "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"per_capita_all = df_full.sort_values('startups_per_capita', ascending=False, ignore_index=True).head(60)\n",
"per_capita_all.index += 1\n",
"per_capita_all"
]
},
{
"cell_type": "markdown",
"id": "1337f519-483a-4101-9c68-783763d42823",
"metadata": {
"tags": []
},
"source": [
"### Show countries by the number of startups overall (all countries)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "b74d6571-b85b-41a6-a748-178d1fe23f89",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"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>iso2</th>\n",
" <th>name</th>\n",
" <th>startup_count</th>\n",
" <th>population</th>\n",
" <th>startups_per_capita</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>US</td>\n",
" <td>United States</td>\n",
" <td>77077</td>\n",
" <td>326687501</td>\n",
" <td>2.359350e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>IN</td>\n",
" <td>India</td>\n",
" <td>16940</td>\n",
" <td>1352617328</td>\n",
" <td>1.252387e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>GB</td>\n",
" <td>United Kingdom</td>\n",
" <td>6990</td>\n",
" <td>66460344</td>\n",
" <td>1.051755e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>CA</td>\n",
" <td>Canada</td>\n",
" <td>3875</td>\n",
" <td>37057765</td>\n",
" <td>1.045665e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>AU</td>\n",
" <td>Australia</td>\n",
" <td>2871</td>\n",
" <td>24982688</td>\n",
" <td>1.149196e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>ID</td>\n",
" <td>Indonesia</td>\n",
" <td>2499</td>\n",
" <td>267663435</td>\n",
" <td>9.336352e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>DE</td>\n",
" <td>Germany</td>\n",
" <td>2412</td>\n",
" <td>82905782</td>\n",
" <td>2.909327e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>FR</td>\n",
" <td>France</td>\n",
" <td>1605</td>\n",
" <td>66977107</td>\n",
" <td>2.396341e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>ES</td>\n",
" <td>Spain</td>\n",
" <td>1457</td>\n",
" <td>46796540</td>\n",
" <td>3.113478e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>BR</td>\n",
" <td>Brazil</td>\n",
" <td>1175</td>\n",
" <td>209469333</td>\n",
" <td>5.609413e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>AE</td>\n",
" <td>United Arab Emirates</td>\n",
" <td>1146</td>\n",
" <td>9630959</td>\n",
" <td>1.189913e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>SG</td>\n",
" <td>Singapore</td>\n",
" <td>1117</td>\n",
" <td>5638676</td>\n",
" <td>1.980961e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>NL</td>\n",
" <td>Netherlands</td>\n",
" <td>1074</td>\n",
" <td>17231624</td>\n",
" <td>6.232727e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>PK</td>\n",
" <td>Pakistan</td>\n",
" <td>1062</td>\n",
" <td>212215030</td>\n",
" <td>5.004358e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>IL</td>\n",
" <td>Israel</td>\n",
" <td>985</td>\n",
" <td>8882800</td>\n",
" <td>1.108885e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>IT</td>\n",
" <td>Italy</td>\n",
" <td>955</td>\n",
" <td>60421760</td>\n",
" <td>1.580556e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>NG</td>\n",
" <td>Nigeria</td>\n",
" <td>810</td>\n",
" <td>195874740</td>\n",
" <td>4.135296e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>CH</td>\n",
" <td>Switzerland</td>\n",
" <td>786</td>\n",
" <td>8513227</td>\n",
" <td>9.232692e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>SE</td>\n",
" <td>Sweden</td>\n",
" <td>723</td>\n",
" <td>10175214</td>\n",
" <td>7.105502e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>PE</td>\n",
" <td>Peru</td>\n",
" <td>695</td>\n",
" <td>31989256</td>\n",
" <td>2.172604e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>RU</td>\n",
" <td>Russia</td>\n",
" <td>651</td>\n",
" <td>144478050</td>\n",
" <td>4.505875e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>CN</td>\n",
" <td>China</td>\n",
" <td>647</td>\n",
" <td>1392730000</td>\n",
" <td>4.645552e-07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>EG</td>\n",
" <td>Egypt</td>\n",
" <td>627</td>\n",
" <td>98423595</td>\n",
" <td>6.370424e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>JP</td>\n",
" <td>Japan</td>\n",
" <td>621</td>\n",
" <td>126529100</td>\n",
" <td>4.907962e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>BE</td>\n",
" <td>Belgium</td>\n",
" <td>603</td>\n",
" <td>11433256</td>\n",
" <td>5.274088e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>TR</td>\n",
" <td>Turkey</td>\n",
" <td>585</td>\n",
" <td>82319724</td>\n",
" <td>7.106438e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>MX</td>\n",
" <td>Mexico</td>\n",
" <td>553</td>\n",
" <td>126190788</td>\n",
" <td>4.382253e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>CO</td>\n",
" <td>Colombia</td>\n",
" <td>527</td>\n",
" <td>49648685</td>\n",
" <td>1.061458e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>PL</td>\n",
" <td>Poland</td>\n",
" <td>506</td>\n",
" <td>37974750</td>\n",
" <td>1.332464e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>30</th>\n",
" <td>ZA</td>\n",
" <td>South Africa</td>\n",
" <td>499</td>\n",
" <td>57779622</td>\n",
" <td>8.636263e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>31</th>\n",
" <td>FI</td>\n",
" <td>Finland</td>\n",
" <td>467</td>\n",
" <td>5515525</td>\n",
" <td>8.467009e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>32</th>\n",
" <td>IE</td>\n",
" <td>Ireland</td>\n",
" <td>462</td>\n",
" <td>4867309</td>\n",
" <td>9.491898e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>33</th>\n",
" <td>AR</td>\n",
" <td>Argentina</td>\n",
" <td>446</td>\n",
" <td>44494502</td>\n",
" <td>1.002371e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>34</th>\n",
" <td>DK</td>\n",
" <td>Denmark</td>\n",
" <td>424</td>\n",
" <td>5793636</td>\n",
" <td>7.318375e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35</th>\n",
" <td>LK</td>\n",
" <td>Sri Lanka</td>\n",
" <td>409</td>\n",
" <td>21670000</td>\n",
" <td>1.887402e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>HK</td>\n",
" <td>Hong Kong SAR China</td>\n",
" <td>404</td>\n",
" <td>7451000</td>\n",
" <td>5.422091e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37</th>\n",
" <td>PT</td>\n",
" <td>Portugal</td>\n",
" <td>389</td>\n",
" <td>10283822</td>\n",
" <td>3.782640e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>38</th>\n",
" <td>CL</td>\n",
" <td>Chile</td>\n",
" <td>385</td>\n",
" <td>18729160</td>\n",
" <td>2.055618e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>39</th>\n",
" <td>UA</td>\n",
" <td>Ukraine</td>\n",
" <td>363</td>\n",
" <td>44622516</td>\n",
" <td>8.134907e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>40</th>\n",
" <td>KR</td>\n",
" <td>South Korea</td>\n",
" <td>344</td>\n",
" <td>51606633</td>\n",
" <td>6.665810e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>41</th>\n",
" <td>PH</td>\n",
" <td>Philippines</td>\n",
" <td>332</td>\n",
" <td>106651922</td>\n",
" <td>3.112930e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>42</th>\n",
" <td>KE</td>\n",
" <td>Kenya</td>\n",
" <td>327</td>\n",
" <td>51393010</td>\n",
" <td>6.362733e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>43</th>\n",
" <td>MY</td>\n",
" <td>Malaysia</td>\n",
" <td>326</td>\n",
" <td>31528585</td>\n",
" <td>1.033982e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44</th>\n",
" <td>NO</td>\n",
" <td>Norway</td>\n",
" <td>321</td>\n",
" <td>5311916</td>\n",
" <td>6.043017e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>45</th>\n",
" <td>AT</td>\n",
" <td>Austria</td>\n",
" <td>316</td>\n",
" <td>8840521</td>\n",
" <td>3.574450e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46</th>\n",
" <td>HU</td>\n",
" <td>Hungary</td>\n",
" <td>311</td>\n",
" <td>9775564</td>\n",
" <td>3.181402e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>47</th>\n",
" <td>VN</td>\n",
" <td>Vietnam</td>\n",
" <td>284</td>\n",
" <td>95540395</td>\n",
" <td>2.972565e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>48</th>\n",
" <td>BD</td>\n",
" <td>Bangladesh</td>\n",
" <td>282</td>\n",
" <td>161356039</td>\n",
" <td>1.747688e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>49</th>\n",
" <td>NZ</td>\n",
" <td>New Zealand</td>\n",
" <td>279</td>\n",
" <td>4841000</td>\n",
" <td>5.763272e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>50</th>\n",
" <td>EE</td>\n",
" <td>Estonia</td>\n",
" <td>270</td>\n",
" <td>1321977</td>\n",
" <td>2.042396e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>51</th>\n",
" <td>RO</td>\n",
" <td>Romania</td>\n",
" <td>267</td>\n",
" <td>19466145</td>\n",
" <td>1.371612e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>52</th>\n",
" <td>IR</td>\n",
" <td>Iran</td>\n",
" <td>266</td>\n",
" <td>81800269</td>\n",
" <td>3.251823e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>53</th>\n",
" <td>AZ</td>\n",
" <td>Azerbaijan</td>\n",
" <td>221</td>\n",
" <td>9939800</td>\n",
" <td>2.223385e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>54</th>\n",
" <td>TH</td>\n",
" <td>Thailand</td>\n",
" <td>177</td>\n",
" <td>69428524</td>\n",
" <td>2.549384e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>55</th>\n",
" <td>LT</td>\n",
" <td>Lithuania</td>\n",
" <td>176</td>\n",
" <td>2801543</td>\n",
" <td>6.282252e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>56</th>\n",
" <td>GR</td>\n",
" <td>Greece</td>\n",
" <td>174</td>\n",
" <td>10731726</td>\n",
" <td>1.621361e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>57</th>\n",
" <td>NP</td>\n",
" <td>Nepal</td>\n",
" <td>161</td>\n",
" <td>28087871</td>\n",
" <td>5.732012e-06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>58</th>\n",
" <td>CZ</td>\n",
" <td>Czech Republic</td>\n",
" <td>153</td>\n",
" <td>10629928</td>\n",
" <td>1.439332e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>59</th>\n",
" <td>BG</td>\n",
" <td>Bulgaria</td>\n",
" <td>151</td>\n",
" <td>7025037</td>\n",
" <td>2.149455e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>60</th>\n",
" <td>GH</td>\n",
" <td>Ghana</td>\n",
" <td>137</td>\n",
" <td>29767108</td>\n",
" <td>4.602395e-06</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" iso2 name startup_count population startups_per_capita\n",
"1 US United States 77077 326687501 2.359350e-04\n",
"2 IN India 16940 1352617328 1.252387e-05\n",
"3 GB United Kingdom 6990 66460344 1.051755e-04\n",
"4 CA Canada 3875 37057765 1.045665e-04\n",
"5 AU Australia 2871 24982688 1.149196e-04\n",
"6 ID Indonesia 2499 267663435 9.336352e-06\n",
"7 DE Germany 2412 82905782 2.909327e-05\n",
"8 FR France 1605 66977107 2.396341e-05\n",
"9 ES Spain 1457 46796540 3.113478e-05\n",
"10 BR Brazil 1175 209469333 5.609413e-06\n",
"11 AE United Arab Emirates 1146 9630959 1.189913e-04\n",
"12 SG Singapore 1117 5638676 1.980961e-04\n",
"13 NL Netherlands 1074 17231624 6.232727e-05\n",
"14 PK Pakistan 1062 212215030 5.004358e-06\n",
"15 IL Israel 985 8882800 1.108885e-04\n",
"16 IT Italy 955 60421760 1.580556e-05\n",
"17 NG Nigeria 810 195874740 4.135296e-06\n",
"18 CH Switzerland 786 8513227 9.232692e-05\n",
"19 SE Sweden 723 10175214 7.105502e-05\n",
"20 PE Peru 695 31989256 2.172604e-05\n",
"21 RU Russia 651 144478050 4.505875e-06\n",
"22 CN China 647 1392730000 4.645552e-07\n",
"23 EG Egypt 627 98423595 6.370424e-06\n",
"24 JP Japan 621 126529100 4.907962e-06\n",
"25 BE Belgium 603 11433256 5.274088e-05\n",
"26 TR Turkey 585 82319724 7.106438e-06\n",
"27 MX Mexico 553 126190788 4.382253e-06\n",
"28 CO Colombia 527 49648685 1.061458e-05\n",
"29 PL Poland 506 37974750 1.332464e-05\n",
"30 ZA South Africa 499 57779622 8.636263e-06\n",
"31 FI Finland 467 5515525 8.467009e-05\n",
"32 IE Ireland 462 4867309 9.491898e-05\n",
"33 AR Argentina 446 44494502 1.002371e-05\n",
"34 DK Denmark 424 5793636 7.318375e-05\n",
"35 LK Sri Lanka 409 21670000 1.887402e-05\n",
"36 HK Hong Kong SAR China 404 7451000 5.422091e-05\n",
"37 PT Portugal 389 10283822 3.782640e-05\n",
"38 CL Chile 385 18729160 2.055618e-05\n",
"39 UA Ukraine 363 44622516 8.134907e-06\n",
"40 KR South Korea 344 51606633 6.665810e-06\n",
"41 PH Philippines 332 106651922 3.112930e-06\n",
"42 KE Kenya 327 51393010 6.362733e-06\n",
"43 MY Malaysia 326 31528585 1.033982e-05\n",
"44 NO Norway 321 5311916 6.043017e-05\n",
"45 AT Austria 316 8840521 3.574450e-05\n",
"46 HU Hungary 311 9775564 3.181402e-05\n",
"47 VN Vietnam 284 95540395 2.972565e-06\n",
"48 BD Bangladesh 282 161356039 1.747688e-06\n",
"49 NZ New Zealand 279 4841000 5.763272e-05\n",
"50 EE Estonia 270 1321977 2.042396e-04\n",
"51 RO Romania 267 19466145 1.371612e-05\n",
"52 IR Iran 266 81800269 3.251823e-06\n",
"53 AZ Azerbaijan 221 9939800 2.223385e-05\n",
"54 TH Thailand 177 69428524 2.549384e-06\n",
"55 LT Lithuania 176 2801543 6.282252e-05\n",
"56 GR Greece 174 10731726 1.621361e-05\n",
"57 NP Nepal 161 28087871 5.732012e-06\n",
"58 CZ Czech Republic 153 10629928 1.439332e-05\n",
"59 BG Bulgaria 151 7025037 2.149455e-05\n",
"60 GH Ghana 137 29767108 4.602395e-06"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"overall = df_full.sort_values('startup_count', ascending=False, ignore_index=True).head(60)\n",
"overall.index += 1\n",
"overall"
]
}
],
"metadata": {
"jupytext": {
"formats": "ipynb,auto:percent"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment