You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blabla/PATSTAT/patstat_analysis_demo.ipynb

785 lines
1.3 MiB
Plaintext

2 years ago
{
"cells": [
{
"cell_type": "code",
"execution_count": 88,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import os\n",
"import pandas as pd\n",
"import janitor\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"from matplotlib.ticker import MaxNLocator\n",
"import math\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 89,
"outputs": [],
"source": [
"outdir=\"EU_CH_scope\"\n",
"\n",
"appln = pd.read_csv(f\"{outdir}/tls_201_scope.csv\")\n",
"\n",
"appln_title = pd.read_csv(f\"{outdir}/tls_202_scope.csv\")\n",
"\n",
"pers = pd.read_csv(f\"{outdir}/tls_206_scope.csv\")\n",
"\n",
"appln_pers = pd.read_csv(f\"{outdir}/tls_207_scope.csv\")\n",
"\n",
"appln_cpc = pd.read_csv(f\"{outdir}/tls_224_scope.csv\")\n",
"\n",
"cpc_desc = pd.read_csv(f\"{outdir}/cpc_defs.csv\")\n",
"\n",
"country_defs = pd.read_csv(f\"{outdir}/table_tls801.csv\").rename(columns={\"st3_name\":\"Country\"})"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 90,
"outputs": [
{
"data": {
"text/plain": " ctry_code iso_alpha3 Country organisation_flag \n0 unknown Y \\\n1 AD AND Andorra \n2 AE ARE United Arab Emirates \n3 AF AFG Afghanistan \n4 AG ATG Antigua and Barbuda \n.. ... ... ... ... \n237 YE YEM Yemen \n238 YU YUG Yugoslavia/Serbia and Montenegro \n239 ZA ZAF South Africa \n240 ZM ZMB Zambia \n241 ZW ZWE Zimbabwe \n\n continent eu_member epo_member oecd_member discontinued \n0 NaN \n1 Europe \n2 Asia \n3 Asia \n4 North America \n.. ... ... ... ... ... \n237 Asia \n238 Europe Y \n239 Africa \n240 Africa \n241 Africa \n\n[242 rows x 9 columns]",
"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>ctry_code</th>\n <th>iso_alpha3</th>\n <th>Country</th>\n <th>organisation_flag</th>\n <th>continent</th>\n <th>eu_member</th>\n <th>epo_member</th>\n <th>oecd_member</th>\n <th>discontinued</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td></td>\n <td></td>\n <td>unknown</td>\n <td>Y</td>\n <td>NaN</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <th>1</th>\n <td>AD</td>\n <td>AND</td>\n <td>Andorra</td>\n <td></td>\n <td>Europe</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <th>2</th>\n <td>AE</td>\n <td>ARE</td>\n <td>United Arab Emirates</td>\n <td></td>\n <td>Asia</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <th>3</th>\n <td>AF</td>\n <td>AFG</td>\n <td>Afghanistan</td>\n <td></td>\n <td>Asia</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <th>4</th>\n <td>AG</td>\n <td>ATG</td>\n <td>Antigua and Barbuda</td>\n <td></td>\n <td>North America</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>237</th>\n <td>YE</td>\n <td>YEM</td>\n <td>Yemen</td>\n <td></td>\n <td>Asia</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <th>238</th>\n <td>YU</td>\n <td>YUG</td>\n <td>Yugoslavia/Serbia and Montenegro</td>\n <td></td>\n <td>Europe</td>\n <td></td>\n <td></td>\n <td></td>\n <td>Y</td>\n </tr>\n <tr>\n <th>239</th>\n <td>ZA</td>\n <td>ZAF</td>\n <td>South Africa</td>\n <td></td>\n <td>Africa</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <th>240</th>\n <td>ZM</td>\n <td>ZMB</td>\n <td>Zambia</td>\n <td></td>\n <td>Africa</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n <tr>\n <th>241</th>\n <td>ZW</td>\n <td>ZWE</td>\n <td>Zimbabwe</td>\n <td></td>\n <td>Africa</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n </tr>\n </tbody>\n</table>\n<p>242 rows × 9 columns</p>\n</div>"
},
"execution_count": 90,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"country_defs"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 91,
"outputs": [
{
"data": {
"text/plain": " appln_id appln_auth appln_nr appln_kind appln_filing_date \n0 340657036 EP 12000117 A 2012-01-09 \\\n1 340982410 EP 12151915 A 2012-01-20 \n2 341078960 EP 12700310 A 2012-01-11 \n3 341078962 EP 12700311 A 2012-01-11 \n4 341127772 EP 12700372 A 2012-01-02 \n\n appln_filing_year appln_nr_original ipr_type receiving_office \n0 2012 12000117 PI \\\n1 2012 12151915 PI \n2 2012 12700310 PI \n3 2012 12700311 PI \n4 2012 12700372 PI \n\n internat_appln_id ... earliest_publn_date earliest_publn_year \n0 0 ... 2013-07-10 2013 \\\n1 0 ... 2012-07-25 2012 \n2 340778427 ... 2014-01-22 2014 \n3 340778431 ... 2014-01-22 2014 \n4 340460188 ... 2014-10-15 2014 \n\n earliest_pat_publn_id granted docdb_family_id inpadoc_family_id \n0 407623142 Y 45507394 340657036 \\\n1 365158710 Y 45531220 340982410 \n2 413564969 Y 45491582 340778427 \n3 413564970 Y 45491583 340778431 \n4 421840120 Y 45495923 340460188 \n\n docdb_family_size nb_citing_docdb_fam nb_applicants nb_inventors \n0 3 6 1 2 \n1 2 16 2 6 \n2 3 2 1 1 \n3 3 3 1 1 \n4 4 8 1 2 \n\n[5 rows x 26 columns]",
"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>appln_id</th>\n <th>appln_auth</th>\n <th>appln_nr</th>\n <th>appln_kind</th>\n <th>appln_filing_date</th>\n <th>appln_filing_year</th>\n <th>appln_nr_original</th>\n <th>ipr_type</th>\n <th>receiving_office</th>\n <th>internat_appln_id</th>\n <th>...</th>\n <th>earliest_publn_date</th>\n <th>earliest_publn_year</th>\n <th>earliest_pat_publn_id</th>\n <th>granted</th>\n <th>docdb_family_id</th>\n <th>inpadoc_family_id</th>\n <th>docdb_family_size</th>\n <th>nb_citing_docdb_fam</th>\n <th>nb_applicants</th>\n <th>nb_inventors</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>340657036</td>\n <td>EP</td>\n <td>12000117</td>\n <td>A</td>\n <td>2012-01-09</td>\n <td>2012</td>\n <td>12000117</td>\n <td>PI</td>\n <td></td>\n <td>0</td>\n <td>...</td>\n <td>2013-07-10</td>\n <td>2013</td>\n <td>407623142</td>\n <td>Y</td>\n <td>45507394</td>\n <td>340657036</td>\n <td>3</td>\n <td>6</td>\n <td>1</td>\n <td>2</td>\n </tr>\n <tr>\n <th>1</th>\n <td>340982410</td>\n <td>EP</td>\n <td>12151915</td>\n <td>A</td>\n <td>2012-01-20</td>\n <td>2012</td>\n <td>12151915</td>\n <td>PI</td>\n <td></td>\n <td>0</td>\n <td>...</td>\n <td>2012-07-25</td>\n <td>2012</td>\n <td>365158710</td>\n <td>Y</td>\n <td>45531220</td>\n <td>340982410</td>\n <td>2</td>\n <td>16</td>\n <td>2</td>\n <td>6</td>\n </tr>\n <tr>\n <th>2</th>\n <td>341078960</td>\n <td>EP</td>\n <td>12700310</td>\n <td>A</td>\n <td>2012-01-11</td>\n <td>2012</td>\n <td>12700310</td>\n <td>PI</td>\n <td></td>\n <td>340778427</td>\n <td>...</td>\n <td>2014-01-22</td>\n <td>2014</td>\n <td>413564969</td>\n <td>Y</td>\n <td>45491582</td>\n <td>340778427</td>\n <td>3</td>\n <td>2</td>\n <td>1</td>\n <td>1</td>\n </tr>\n <tr>\n <th>3</th>\n <td>341078962</td>\n <td>EP</td>\n <td>12700311</td>\n <td>A</td>\n <td>2012-01-11</td>\n <td>2012</td>\n <td>12700311</td>\n <td>PI</td>\n <td></td>\n <td>340778431</td>\n <td>...</td>\n <td>2014-01-22</td>\n <td>2014</td>\n <td>413564970</td>\n <td>Y</td>\n <td>45491583</td>\n <td>340778431</td>\n <td>3</td>\n <td>3</td>\n <td>1</td>\n <td>1</td>\n </tr>\n <tr>\n <th>4</th>\n <td>341127772</td>\n <td>EP</td>\n <td>12700372</td>\n <td>A</td>\n <td>2012-01-02</td>\n <td>2012</td>\n <td>12700372</td>\n <td>PI</td>\n <td></td>\n <td>340460188</td>\n <td>...</td>\n <td>2014-10-15</td>\n <td>2014</td>\n <td>421840120</td>\n <td>Y</td>\n <td>45495923</td>\n <td>340460188</td>\n <td>4</td>\n <td>8</td>\n <td>1</td>\n <td>2</td>\n </tr>\n </tbody>\n</table>\n<p>5 rows × 26 columns</p>\n</div>"
},
"execution_count": 91,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"appln.head()"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 120,
"outputs": [
{
"data": {
"text/plain": "Text(0.5, 0, 'Year')"
},
"execution_count": 120,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png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qKpVTygcPHqzy3KeffhqVlZW4cOECTExMsH79egwYMAA5OTk4ffo0tm3bhiNHjgDAI08AOH36NARBeGivKioqEB0drVy2vu9DmzZtYG9vjwkTJmDWrFk4dOgQHB0d8cEHH6h8Fojqw0jsAoh01f/93//hzz//xLRp0x553Exd3PtFcC9zc/PHPu/e42dqOTg4ICsrC0DNAckpKSnw8/N76PPv/bL5t9e6desWgJqQdS8jIyPY2dmhuLj4sc+/V+2yZmZmymkFBQXK+u91/2MADz2w+qeffsIXX3yBrKws2Nraol27djA1NX1guXtfE6gJFgBUjn+5V+1B3ePGjXvo/Bs3buDWrVsQBAF2dnYq85ydnR/6nNoaSkpKHvmatra2ytruV5f34uzZs3j11VdV5m/evFkZvmoDRy17e3uVsU+cOIFPPvkESUlJsLCwgK+vr/IzIjzi2jy1vbo/mNXKyclR/rm+74OFhQW2bt2Kr776Cv/73/+wfft2mJqa4rnnnsP//d//wcTE5KHPI3ocBiCiJ2RjY4PZs2cjMjISq1ateugy9x8oW1pa2mivX/tlda/c3Fzll5mVlRXCwsLw4YcfPvT59fnSsLGxUY5f+yUK1By4fPPmzQe+/B+ndtmioiJlrbVfyHl5eXB1dVUuWxuMHuevv/7CRx99hFdeeQWvvfaacqzPP/9cZavDk7C2tgYALFq0CJ6eng/Md3R0VIaVvLw8lXm1geB+tVvxHtUzKysrFBYWQhAESCQS5fQrV65AEIQ6vRd
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = appln.groupby(\"appln_filing_year\", as_index=False)[\"appln_id\"].count()\n",
"data\n",
"g = sns.lineplot(data, x=\"appln_filing_year\", y=\"appln_id\")\n",
"g.set_title(\"Number of (granted) co-patents\")\n",
"g.set_ylabel(\"Count\")\n",
"g.set_xlabel(\"Year\")"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 93,
"outputs": [],
"source": [
"patstat_collabs = appln_pers.merge(pers, on=\"person_id\")\n",
"patstat_collabs = patstat_collabs.merge(country_defs, left_on=\"person_ctry_code\", right_on=\"ctry_code\")\n",
"patstat_collabs = patstat_collabs.groupby(\"appln_id\",as_index=False)[\"Country\"].unique().explode('Country')"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 94,
"outputs": [],
"source": [
"ch_codes = [\"CN\",\"HK\",\"MO\",\"TW\"]\n",
"ch_names = country_defs[country_defs[\"ctry_code\"].isin(ch_codes)][\"Country\"].unique()"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 95,
"outputs": [
{
"data": {
"text/plain": " Country count percent weight\n0 China 18189 0.849160 0.400665\n1 Taiwan Province Of China 2667 0.124510 0.058748\n2 Hong Kong, China 859 0.040103 0.018922\n3 Macao SAR (China) 13 0.000607 0.000286",
"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>Country</th>\n <th>count</th>\n <th>percent</th>\n <th>weight</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>China</td>\n <td>18189</td>\n <td>0.849160</td>\n <td>0.400665</td>\n </tr>\n <tr>\n <th>1</th>\n <td>Taiwan Province Of China</td>\n <td>2667</td>\n <td>0.124510</td>\n <td>0.058748</td>\n </tr>\n <tr>\n <th>2</th>\n <td>Hong Kong, China</td>\n <td>859</td>\n <td>0.040103</td>\n <td>0.018922</td>\n </tr>\n <tr>\n <th>3</th>\n <td>Macao SAR (China)</td>\n <td>13</td>\n <td>0.000607</td>\n <td>0.000286</td>\n </tr>\n </tbody>\n</table>\n</div>"
},
"execution_count": 95,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"country_collab = patstat_collabs[patstat_collabs[\"Country\"].isin(ch_names)][\"Country\"].value_counts().reset_index()\n",
"country_collab[\"percent\"] = country_collab[\"count\"]/patstat_collabs[\"appln_id\"].nunique()\n",
"country_collab[\"weight\"] = country_collab[\"count\"]/patstat_collabs[\"appln_id\"].size\n",
"country_collab"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 96,
"outputs": [
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtUAAAGwCAYAAABmYpkfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABaWUlEQVR4nO3dd3xO9///8WcixEhIjaL2qBiJBCEqURV7xActSm1qS1ujNiUURati12yrWlvRqtkWtYXaM5HYoxFbJNf5/eHn+rqaRMIJSepxv93c5Hqf9znn9T7Xda48c/K+TuwMwzAEAAAA4LnZJ3cBAAAAQGpHqAYAAABMIlQDAAAAJhGqAQAAAJMI1QAAAIBJhGoAAADAJEI1AAAAYBKhGgAAADCJUA0AAACY5JDcBQAp3T//3JLFktxVvDx2dlK2bM66fv2WXqW/t8q4GfergHEz7leBvb2UNavzS98voRpIgGHolXozeoxxv1oY96uFcb9aXrVxJ9dYmf4BAAAAmESoBgAAAEwiVAMAAAAmEaoBAAAAkwjVAAAAgEnc/QNIgL29vexfwR8/06R5BQctxv2qYdyvFsb9fCwWQxbLK3T7kOdkZxiv0k1WAAAA8Cyiow1FRt5JNcHa3v7R/blfNq5UAwno1++aDh+OSu4yAAB46YoWTauJE3PI3t4u1YTq5EKoBhJw5sxDQjUAAHiqV3NyEQAAAJCECNUAAACASYRqAAAAwCRCNQAAAGASoRoAAAAwiVANAAAAmESoBgAAAEwiVAMAAAAmEaoBAAAAkwjVAAAAgEmEagAAAMAkQjUAAABgEqEaAAAAMIlQDQAAAJhEqAYAAABMIlQDAAAAJhGqAQAAAJMI1QAAAIBJhGoAAADAJEI1AAAAYBKhGgAAADCJUA0AAAC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jRozRkiU/qk2b9xUeflYTJ05VxowZX/Swngu31MNL07NnTzVp0kQdOnRQz549lStXLu3cuVPjxo1T69atVbRo0STbl4uLi4KDg3X8+HHZ29trxowZunr1aqxADwAAns3WrXtsHvv6VpGvb5UE1xs06LNYba+/nlOjRo2Ld51KlXxVqZLvM9eYHAjVeGly5MihhQsXKigoSH369NGNGzeUP39+BQQEqHnz5km6rx49emjAgAFq1qyZnJycVKVKFTVv3lxHjx5N0v0AAABIkp3B78OBp2rS5KL27In/w5IAAPxXlSqVTqtXv6GIiDtx/vGXlMjeXsqWLeG7jSX5fl/6HgEAAID/GEI1AAAAYBKhGgAAADCJUA0AAACYRKgGAAAATCJUAwAAACYRqgEAAACTCNUAAACASYRqAAAAwCRCNQAAAGASoRoAAAAwiVANAAAAmESoBgAAAEwiVAMAAAAmEaoBAAAAkwjVAAAAgEmEagAAAMAkQjUAAABgEqEaAAAAMIlQDQAAAJhEqAYAAABMIlQDAAAAJhGqAQAAAJMI1QAAAIBJhGoAAADAJEI1AAAAYBKhGgAAADCJUA0AAACY5JDcBQApXeHCaXXvnpHcZQAA8NIVLZo2uUtINewMwyAtAAAAIE7R0YYiI+/IYkkdkdHeXsqWzfml75cr1UACIiLuJHcJL91rr2Vi3K8Qxv1qYdyvlqQYt8VipJpAnZwI1UACLBaLLJbkruLlsbN79H9MjEWv0u+xGDfjfhUwbsaNF4cPKgIAAAAmEaoBAAAAkwjVAAAAgEmEagAAAMAkQjUAAABgEqEaAAAAMIlQDQAAAJhEqAYAAABMIlQDAAAAJhGqAQAAAJMI1QAAAIBJhGoAAADAJEI1AAAAYBKhGgAAADCJUA0AAACY5JDcBQApnb29vexfwR8/06T5v0FbLIYsFiMZqwEAIGU
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = country_collab\n",
"g = sns.barplot(data, x=\"count\", y=\"Country\", color=\"blue\")\n",
"g.set_xlim(0,20000)\n",
"g.set_ylabel(\"Country\")\n",
"g.set_xlabel(\"Number of co-patents\")\n",
"for i in g.containers:\n",
" g.bar_label(i,)"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 97,
"outputs": [
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAs0AAAGwCAYAAABSG1gDAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABUlklEQVR4nO3deXhN1//28TuEBAmpCG0JNTRRkYkQQ1TFHDUVbWlRVTPpgIZQiqh5DIoWoVVaqlq0NWtr+FLzUNQUMdSURsyZzn7+8Dg/p0ns0JCU9+u6cslZe521P3sv5D476+xjZxiGIQAAAADpypHVBQAAAADZHaEZAAAAMEFoBgAAAEwQmgEAAAAThGYAAADABKEZAAAAMEFoBgAAAEwQmgEAAAAThGYAAADAhH1WFwBkd3//fVUWS1ZX8WSzs5NcXZ0VG3tVfIZp1mIusg/mInthPrKPHDmkggWdM31cQjNgwjDEf4DZBHORfTAX2Qdzkb0wH1nvYZ1/lmcAAAAAJgjNAAAAgAlCMwAAAGCC0AwAAACYIDQDAAAAJrh7BmAiR44cysHLy2whZ04mIrtgLrIP5iJ7eZjzYbEYsli4NUdWsTMMbowCAACQ3SUnG4qPv05wNpEjx+17Zmc2rjQDJsLCLunAgcSsLgMA8AQrUyaXJk50U44cdoTmLEJoBkwcP55EaAYA4AnHQigAAADABKEZAAAAMEFoBgAAAEwQmgEAAAAThGYAAADABKEZAAAAMEFoBgAAAEwQmgEAAAAThGYAAADABKEZAAAAMEFoBgAAAEwQmgEAAAAThGYAAADABKEZAAAAMEFoBgAAAEwQmgEAAAAThGYAAADABKEZAAAAMEFoBgAAAEwQmgEAAAAThGYAAADABKEZAAAAMEFoBgAAAEwQmgEAAAAThGYAAADABKEZAAAAMEFoBgAAAEwQmgEAAAAThGYAAID/iPPnz+nDD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pUybT9uXi4qJdu3bp8OHDypEjh2bMmKGLFy+mCuwAAPyXlCxZShMnTjPtt3Gj7Udod+zYRR07drE+dnUtpFGj0n6Tfd++4ab3en4SEZrxyLi5uWnBggWKjIxUnz59dPnyZRUvXlyhoaFq3bp1pu6rZ8+e6t+/v1577TU5OTmpZs2aat26tQ4ePJip+wEAAE8GO4PfVwP31KrVX9q+Pf03IwIA8LB5eeXW8uXPKi7uupKTLVldTraWI4fk6mp+t677HjfTRwQAAAAeM4RmAAAAwAShGQAAADBBaAYAAABMEJoBAAAAE4RmAAAAwAShGQAAADBBaAYAAABMEJoBAAAAE4RmAAAAwAShGQAAADBBaAYAAABMEJoBAAAAE4RmAAAAwAShGQAAADBBaAYAAABMEJoBAAAAE4RmAAAAwAShGQAAADBBaAYAAABMEJoBAAAAE4RmAAAAwAShGQAAADBBaAYAAABMEJoBAAAAE4RmAAAAwAShGQAAADBBaAYAAABM2Gd1AUB2V6pULt28aWR1GQCAJ1iZMrmyuoQnnp1hGKQBAACAbC452VB8/HVZLES3e8mRQ3J1dc70cbnSDJiIi7ue1SVA0lNP5WMusgnmIvtgLrKXhz0fFotBYM5ChGbAhMVikcWS1VU82ezsbv+ZkmIRvxvLWsxF9sFcZC/Mx+OPNwICAAAAJgjNAAAAgAlCMwAAAGCC0AwAAACYIDQDAAAAJgjNAAAAgAlCMwAAAGCC0AwAAACYIDQDAAAAJgjNAAAAgAlCMwAAAGCC0AwAAACYIDQDAAAAJgjNAAAAgAlCMwAAAGDCPqsLALK7HDlyKMcT9vLSYjFksRhZXQYAANkGoRkw8dRT+bK6hEcuOdlQfPx1gjMAAP8foRkwERZ2SQcOJGZ
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = country_collab\n",
"data[\"percent_round\"] = (data[\"percent\"]*100).round(2)\n",
"g = sns.barplot(data, x=\"percent_round\", y=\"Country\", color=\"blue\")\n",
"g.set_xlim(0,100)\n",
"g.set_ylabel(\"Country\")\n",
"g.set_xlabel(\"Percentage of co-patents\")\n",
"for i in g.containers:\n",
" # g.bar_label(i,fmt='%.2f%%')\n",
" g.bar_label(i,fmt='%.2f')"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 98,
"outputs": [
{
"data": {
"text/plain": " Country count percent weight\n0 Germany 7248 0.338375 0.159658\n1 Sweden 3679 0.171755 0.081041\n2 France 3450 0.161064 0.075996\n3 Netherlands 2734 0.127638 0.060224\n4 Finland 1377 0.064286 0.030332\n5 Belgium 1056 0.049300 0.023261\n6 Italy 1052 0.049113 0.023173\n7 Ireland 628 0.029318 0.013834\n8 Denmark 525 0.024510 0.011565\n9 Spain 478 0.022316 0.010529\n10 Austria 439 0.020495 0.009670\n11 Poland 277 0.012932 0.006102\n12 Luxembourg 170 0.007937 0.003745\n13 Greece 111 0.005182 0.002445\n14 Czechia 100 0.004669 0.002203\n15 Portugal 64 0.002988 0.001410\n16 Hungary 48 0.002241 0.001057\n17 Romania 48 0.002241 0.001057\n18 Cyprus 37 0.001727 0.000815\n19 Bulgaria 36 0.001681 0.000793\n20 Slovakia 32 0.001494 0.000705\n21 Malta 26 0.001214 0.000573\n22 Lithuania 15 0.000700 0.000330\n23 Croatia 13 0.000607 0.000286\n24 Slovenia 12 0.000560 0.000264\n25 Estonia 10 0.000467 0.000220\n26 Latvia 4 0.000187 0.000088",
"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>Country</th>\n <th>count</th>\n <th>percent</th>\n <th>weight</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>Germany</td>\n <td>7248</td>\n <td>0.338375</td>\n <td>0.159658</td>\n </tr>\n <tr>\n <th>1</th>\n <td>Sweden</td>\n <td>3679</td>\n <td>0.171755</td>\n <td>0.081041</td>\n </tr>\n <tr>\n <th>2</th>\n <td>France</td>\n <td>3450</td>\n <td>0.161064</td>\n <td>0.075996</td>\n </tr>\n <tr>\n <th>3</th>\n <td>Netherlands</td>\n <td>2734</td>\n <td>0.127638</td>\n <td>0.060224</td>\n </tr>\n <tr>\n <th>4</th>\n <td>Finland</td>\n <td>1377</td>\n <td>0.064286</td>\n <td>0.030332</td>\n </tr>\n <tr>\n <th>5</th>\n <td>Belgium</td>\n <td>1056</td>\n <td>0.049300</td>\n <td>0.023261</td>\n </tr>\n <tr>\n <th>6</th>\n <td>Italy</td>\n <td>1052</td>\n <td>0.049113</td>\n <td>0.023173</td>\n </tr>\n <tr>\n <th>7</th>\n <td>Ireland</td>\n <td>628</td>\n <td>0.029318</td>\n <td>0.013834</td>\n </tr>\n <tr>\n <th>8</th>\n <td>Denmark</td>\n <td>525</td>\n <td>0.024510</td>\n <td>0.011565</td>\n </tr>\n <tr>\n <th>9</th>\n <td>Spain</td>\n <td>478</td>\n <td>0.022316</td>\n <td>0.010529</td>\n </tr>\n <tr>\n <th>10</th>\n <td>Austria</td>\n <td>439</td>\n <td>0.020495</td>\n <td>0.009670</td>\n </tr>\n <tr>\n <th>11</th>\n <td>Poland</td>\n <td>277</td>\n <td>0.012932</td>\n <td>0.006102</td>\n </tr>\n <tr>\n <th>12</th>\n <td>Luxembourg</td>\n <td>170</td>\n <td>0.007937</td>\n <td>0.003745</td>\n </tr>\n <tr>\n <th>13</th>\n <td>Greece</td>\n <td>111</td>\n <td>0.005182</td>\n <td>0.002445</td>\n </tr>\n <tr>\n <th>14</th>\n <td>Czechia</td>\n <td>100</td>\n <td>0.004669</td>\n <td>0.002203</td>\n </tr>\n <tr>\n <th>15</th>\n <td>Portugal</td>\n <td>64</td>\n <td>0.002988</td>\n <td>0.001410</td>\n </tr>\n <tr>\n <th>16</th>\n <td>Hungary</td>\n <td>48</td>\n <td>0.002241</td>\n <td>0.001057</td>\n </tr>\n <tr>\n <th>17</th>\n <td>Romania</td>\n <td>48</td>\n <td>0.002241</td>\n <td>0.001057</td>\n </tr>\n <tr>\n <th>18</th>\n <td>Cyprus</td>\n <td>37</td>\n <td>0.001727</td>\n <td>0.000815</td>\n </tr>\n <tr>\n <th>19</th>\n <td>Bulgaria</td>\n <td>36</td>\n <td>0.001681</td>\n <td>0.000793</td>\n </tr>\n <tr>\n <th>20</th>\n <td>Slovakia</td>\n <td>32</td>\n <td>0.001494</td>\n <td>0.000705</td>\n </tr>\n <tr>\n <th>21</th>\n <td>Malta</td>\n <td>26</td>\n <td>0.001214</td>\n <td>0.000573</td>\n </tr>\n <tr>\n <th>22</th>\n <td>Lithuania</td>\n <td>15</td>\n <td>0.000700</td>\n <td>0.000330</td>\n </tr>\n <tr>\n <th>23</th>\n <td>Croatia</td>\n <td>13</td>\n <td>0.000607</td>\n <td>0.000286</td>\n </tr>\n <tr>\n <th>24</th>\n <td>Slovenia</td>\n <td>12</td>\n <td>0.000560</td>\n <td>0.000264</td>\n </tr>\n <tr>\n <th>25</th>\n <td>Estonia</td>\n <td>10</td>\n <td>0.000467</td>\n <td>0.000220</td>\n </tr>\n <tr>\n <th>26</th>\n <td>Latvia</td>\n <td>4</td>\n <td>0.000187</td>\n <td>0.000088</td>
},
"execution_count": 98,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"country_collab = patstat_collabs[~patstat_collabs[\"Country\"].isin(ch_names)][\"Country\"].value_counts().reset_index()\n",
"country_collab[\"percent\"] = country_collab[\"count\"]/patstat_collabs[\"appln_id\"].nunique()\n",
"country_collab[\"weight\"] = country_collab[\"count\"]/patstat_collabs[\"appln_id\"].size\n",
"country_collab"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 99,
"outputs": [
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAn0AAAGxCAYAAAAXsQCfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24z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LkHUplGrdv32b27GlcuPAX+voGdOjQia5duwPw8OFDZs6czNmzpzExMaVPn4E0aNAIABeXzPcdHTvWj6ZNWxAT85RZs6Zy6tQJDA2N6NGjF25uLTO953OmoZH+a2qqMkfyk+YV0u/81e+ckG+CvuTkZBYtWkRYWBiPHj3CxMSEJk2a4OnpmWHRR1YKDAzkxIkThISEvFf5sWPHUrp0aWbMmPFJzzU2zp8Bo/Q7f/kc+p2UlMqoUUOws6vIihXruHv3Nn5+PpiYFMPVtSGjRg2mVCkzVq5cx5kzp/H3H0eZMmWwtrZh+/Z9anX9+ON6Dh06SN269UlLS2PMmBGkpiqZP38RT548YdIkX4oUKUK9eq5vaY0QIj/LN0HfzJkzOXr0KJMmTcLCwoI7d+4QEBBAZGRkntn8WE9PTy0zyKfw9o7i0qX3XzwihMh6NjbajBmTRrly5RkxYjSFCxfBwqI01arV4Pz5cxQuXIjHjx+xcOFyihTRo3RpK44fP8qFC+extrZR2z/s/v17bN68icWLF6Gnp8eVK5e5cOE8mzaFYWZmTvnydnTr1p3160Mk6BNCZCrfBH3btm1j8uTJqkwZ5ubm+Pn50a1bNx4/fkyxYsVyuYVZKyIiWYI+IfKAYsVKERAwjZQUJWlpaVy48Bd//XWGYcNGc/bsaapVq06RIv/MNkyZMivTepY
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = country_collab\n",
"g = sns.barplot(data, x=\"count\", y=\"Country\", color=\"blue\")\n",
"g.set_xlim(0,8000)\n",
"g.set_ylabel(\"Country\")\n",
"g.set_xlabel(\"Number of co-patents\")\n",
"for i in g.containers:\n",
" g.bar_label(i,)"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 100,
"outputs": [
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAGxCAYAAADvUftoAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly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9vXF1dUWhUNCmTRuKFSvGhQsXXrmOli1b4u/vj7Oz8xu3Y9o0kze+VwghhHhbmZnZKJXyguFd08h+1TFC8c5cv36dDh068Mcff1CiRIk3qiM+PjmfW/XhMzIqIf0uRKTfhYv0++OjVL5ZYKehASYm+sTGPv6oUoK9LU1NUCgkV+wnJSkpiUOHDrFx40batm37xkGdECJ/PfsLKj09nT59/sewYaOxt3cgMNCf3bt35LrH3t6B4OAXb1U0bdpkTExM6dOnv+rcvXt3mTVrKqdPn8LAwICuXd3o2jVnk/KnU4myspSF6hee9Ltw9Vu8nUIT2GVkZLBw4UIiIiK4d+8eJiYmtGrVCi8vL9WWIwUhJCSEo0ePsnr16lcq7+vrS4UKFZgxI+/5CK/KyKhwBoXS78LlXfU7MzObxMRkUlJSmTjRl2vXolTXhgwZyYABg1THd+7cYfDg/nz1VfcX1rl27Uq2b4+gV69v1c5PmDCOMmXKsHTpaq5fj2LiRF9Kly5LkyZf5m+nhBCfpEIT2M2cOZPDhw8zefJkzM3NuXnzJoGBgURHR38wGwDr6empZcB4G2PGxBIZ+eoLNoQQebOy0mbuXFOio68xfrx3rhXuenp6av84DAz058svm6ltyPqs5OQkgoImceLEcUqVKq127dG
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = country_collab\n",
"data[\"percent_round\"] = (data[\"percent\"]*100).round(2)\n",
"g = sns.barplot(data, x=\"percent_round\", y=\"Country\", color=\"blue\")\n",
"g.set_xlim(0,40)\n",
"g.set_ylabel(\"Country\")\n",
"g.set_xlabel(\"Percentage of co-patents\")\n",
"for i in g.containers:\n",
" # g.bar_label(i,fmt='%.2f%%')\n",
" g.bar_label(i,fmt='%.2f')"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
"source": [
"# Pivot country - year"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 106,
"outputs": [
{
"data": {
"text/plain": " appln_id Country appln_filing_year\n0 340657036 Denmark 2012\n1 340657036 China 2012\n2 340982410 Denmark 2012\n3 340982410 China 2012\n4 341078960 Germany 2012\n... ... ... ...\n45392 575326930 China 2021\n45393 575399552 Sweden 2020\n45394 575399552 China 2020\n45395 575406608 Germany 2014\n45396 575406608 China 2014\n\n[45397 rows x 3 columns]",
"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>appln_id</th>\n <th>Country</th>\n <th>appln_filing_year</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>340657036</td>\n <td>Denmark</td>\n <td>2012</td>\n </tr>\n <tr>\n <th>1</th>\n <td>340657036</td>\n <td>China</td>\n <td>2012</td>\n </tr>\n <tr>\n <th>2</th>\n <td>340982410</td>\n <td>Denmark</td>\n <td>2012</td>\n </tr>\n <tr>\n <th>3</th>\n <td>340982410</td>\n <td>China</td>\n <td>2012</td>\n </tr>\n <tr>\n <th>4</th>\n <td>341078960</td>\n <td>Germany</td>\n <td>2012</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>45392</th>\n <td>575326930</td>\n <td>China</td>\n <td>2021</td>\n </tr>\n <tr>\n <th>45393</th>\n <td>575399552</td>\n <td>Sweden</td>\n <td>2020</td>\n </tr>\n <tr>\n <th>45394</th>\n <td>575399552</td>\n <td>China</td>\n <td>2020</td>\n </tr>\n <tr>\n <th>45395</th>\n <td>575406608</td>\n <td>Germany</td>\n <td>2014</td>\n </tr>\n <tr>\n <th>45396</th>\n <td>575406608</td>\n <td>China</td>\n <td>2014</td>\n </tr>\n </tbody>\n</table>\n<p>45397 rows × 3 columns</p>\n</div>"
},
"execution_count": 106,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"record_col = \"appln_id\"\n",
"patstat_collabs_y=patstat_collabs.merge(appln[[record_col,\"appln_filing_year\"]], on=\"appln_id\")\n",
"patstat_collabs_y"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 111,
"outputs": [
{
"data": {
"text/plain": " appln_filing_year Country count appln_id percent\n0 2012 China 2581 3001 0.860047\n1 2012 Germany 888 3001 0.295901\n2 2012 France 653 3001 0.217594\n3 2012 Sweden 473 3001 0.157614\n4 2012 Netherlands 406 3001 0.135288\n.. ... ... ... ... ...\n264 2022 China 4 5 0.800000\n265 2022 Netherlands 2 5 0.400000\n266 2022 Spain 2 5 0.400000\n267 2022 Hong Kong, China 1 5 0.200000\n268 2022 Czechia 1 5 0.200000\n\n[269 rows x 5 columns]",
"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>appln_filing_year</th>\n <th>Country</th>\n <th>count</th>\n <th>appln_id</th>\n <th>percent</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>2012</td>\n <td>China</td>\n <td>2581</td>\n <td>3001</td>\n <td>0.860047</td>\n </tr>\n <tr>\n <th>1</th>\n <td>2012</td>\n <td>Germany</td>\n <td>888</td>\n <td>3001</td>\n <td>0.295901</td>\n </tr>\n <tr>\n <th>2</th>\n <td>2012</td>\n <td>France</td>\n <td>653</td>\n <td>3001</td>\n <td>0.217594</td>\n </tr>\n <tr>\n <th>3</th>\n <td>2012</td>\n <td>Sweden</td>\n <td>473</td>\n <td>3001</td>\n <td>0.157614</td>\n </tr>\n <tr>\n <th>4</th>\n <td>2012</td>\n <td>Netherlands</td>\n <td>406</td>\n <td>3001</td>\n <td>0.135288</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>264</th>\n <td>2022</td>\n <td>China</td>\n <td>4</td>\n <td>5</td>\n <td>0.800000</td>\n </tr>\n <tr>\n <th>265</th>\n <td>2022</td>\n <td>Netherlands</td>\n <td>2</td>\n <td>5</td>\n <td>0.400000</td>\n </tr>\n <tr>\n <th>266</th>\n <td>2022</td>\n <td>Spain</td>\n <td>2</td>\n <td>5</td>\n <td>0.400000</td>\n </tr>\n <tr>\n <th>267</th>\n <td>2022</td>\n <td>Hong Kong, China</td>\n <td>1</td>\n <td>5</td>\n <td>0.200000</td>\n </tr>\n <tr>\n <th>268</th>\n <td>2022</td>\n <td>Czechia</td>\n <td>1</td>\n <td>5</td>\n <td>0.200000</td>\n </tr>\n </tbody>\n</table>\n<p>269 rows × 5 columns</p>\n</div>"
},
"execution_count": 111,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"countall = patstat_collabs_y.groupby(\"appln_filing_year\", as_index=False)[record_col].nunique()\n",
"data = patstat_collabs_y.groupby(\"appln_filing_year\", as_index=False)[\"Country\"].value_counts().merge(countall, on=\"appln_filing_year\")\n",
"data[\"percent\"] = data[\"count\"]/data[record_col]\n",
"data_ch = data[data[\"Country\"].isin(ch_names)]\n",
"data_ch"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 116,
"outputs": [
{
"data": {
"text/plain": "Text(95.7222222222222, 0.5, '')"
},
"execution_count": 116,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/plain": "<Figure size 1000x300 with 2 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA4UAAAEnCAYAAAAem+ZsAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAACpAUlEQVR4nOzdd1gU5xbA4R9tEaUpICpgwQI2iijYK/beWxBbbCA3drHX2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Yrh7oc+fOUadOHWVBCMk9ak2bNuXatWu8fv1auf9dYflOgQIFlEVmyZIlyZcvH/369WPcuHEcOnQIU1NThg0b9tl5ks2bN0db+/332w0bNgTg/Pnz3Lt3j6dPn1K3bl2Vn1elSpXQ19fn1KlTKtf63HuxWLFiODk5sXv3bgBiYmLYt2+fspfw0qVLxMTEpHi+d6v1vnu+kSNHMnToUF6+fMnly5fZvXs3vr6+ACle/8/FJIQQGUV6CoUQ4hszZswYTp8+jbe390fn4aXFhx/mP/RhMZKad8Xjh0xMTHjy5AmQvOjLgwcPKFu2bKrnR0dHp/m53s3t+rCQg+TiI2/evJ8dXvihiIiIj/Yivnuufz8PvM/35cuXLF68mEWLFqm03759W/nf+fPnV2kzMTEhKSlJpahOi3/HoampSd68edN0nYiICExMTD55zK+//qocHmxsbEzp0qXJlStXumKMjIxM9b1gampKUlKSyjBLPT09lWM0NTWVwzfz5MmDr68vS5cuZd++fWzZsoVcuXLRsmVLxowZ88nVds3NzVUev8s7MjJSufj
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(10,3))\n",
"g = sns.heatmap(pd.pivot_table(data_ch,columns=\"appln_filing_year\", index=\"Country\", values=\"count\").fillna(0).astype(int),\n",
" annot=True, fmt=\".0f\",linewidth=.5)\n",
"g.set_title(\"Number of co-patents per year\")\n",
"g.set_xlabel(\"\")\n",
"g.set_ylabel(\"\")"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 118,
"outputs": [
{
"data": {
"text/plain": "Text(95.7222222222222, 0.5, '')"
},
"execution_count": 118,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/plain": "<Figure size 1000x300 with 2 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA3UAAAEnCAYAAAAO12r1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMA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ZK27Ztlbi4OCUuLk6pVq2a0qNHD7X3X7hwQTE2NlZOnjypKMrHH2pXr15VlXn9+rVSrlw5Zdq0aWrvnTJliqq+tm3bKk2aNFFiYmJU2z09PZWyZcsqmzdvVhQlPqkzNjZW/vrrL1WZyMhIxdzcXJk8ebJq3ec/IFetWqWMHDlS7bNDQkIUY2NjZeXKlYqiKMqCBQsUc3Nzxc/PT1XGx8dHMTU1Vf2A9/T0VExMTFTvSTB//nzF3NxcCQ4OTvI73rJli2JsbKzcuHFDbf2YMWMUc3NzJSQkRFGU+B+CNWvWTLKOBC1btlRatGih9iMwIQENCAhQBg8erDg4OChv375VbY+Ojlbq16+vtGrV6qt1jxw5MtG+8/f3V8zNzZXZs2criqIoe/bsUXr27KnExsaqysTGxiq2trbK+PHjVes+3wdDhw5VKlWqpNaukJAQxdbWVpkxY4aiKB+Tuvnz56u1q1atWkqfPn1Ur2vWrKm2P7t3765069ZN7T2bNm1S9u7d+8VYkzpO37x5o1hYWCgTJkxQK/vXX38pxsbGyqNHjxRFUU/q/Pz8FCcnJ7V6FCX+2DYzM1O9/nzfnjt3TjE2NlYOHTqk9r7hw4crlStXVqKjo5XXr18rpqamqu8
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(10,3))\n",
"g = sns.heatmap(pd.pivot_table(data_ch,columns=\"appln_filing_year\", index=\"Country\", values=\"percent\").fillna(0)*100,\n",
" annot=True, fmt=\".2f\",linewidth=.5)\n",
"g.set_title(\"Percentage of co-patents related to country per year\")\n",
"g.set_xlabel(\"\")\n",
"g.set_ylabel(\"\")"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 112,
"outputs": [
{
"data": {
"text/plain": " appln_filing_year Country count appln_id percent\n1 2012 Germany 888 3001 0.295901\n2 2012 France 653 3001 0.217594\n3 2012 Sweden 473 3001 0.157614\n4 2012 Netherlands 406 3001 0.135288\n6 2012 Finland 257 3001 0.085638\n.. ... ... ... ... ...\n262 2021 Hungary 1 127 0.007874\n263 2021 Croatia 1 127 0.007874\n265 2022 Netherlands 2 5 0.400000\n266 2022 Spain 2 5 0.400000\n268 2022 Czechia 1 5 0.200000\n\n[231 rows x 5 columns]",
"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>appln_filing_year</th>\n <th>Country</th>\n <th>count</th>\n <th>appln_id</th>\n <th>percent</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>1</th>\n <td>2012</td>\n <td>Germany</td>\n <td>888</td>\n <td>3001</td>\n <td>0.295901</td>\n </tr>\n <tr>\n <th>2</th>\n <td>2012</td>\n <td>France</td>\n <td>653</td>\n <td>3001</td>\n <td>0.217594</td>\n </tr>\n <tr>\n <th>3</th>\n <td>2012</td>\n <td>Sweden</td>\n <td>473</td>\n <td>3001</td>\n <td>0.157614</td>\n </tr>\n <tr>\n <th>4</th>\n <td>2012</td>\n <td>Netherlands</td>\n <td>406</td>\n <td>3001</td>\n <td>0.135288</td>\n </tr>\n <tr>\n <th>6</th>\n <td>2012</td>\n <td>Finland</td>\n <td>257</td>\n <td>3001</td>\n <td>0.085638</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>262</th>\n <td>2021</td>\n <td>Hungary</td>\n <td>1</td>\n <td>127</td>\n <td>0.007874</td>\n </tr>\n <tr>\n <th>263</th>\n <td>2021</td>\n <td>Croatia</td>\n <td>1</td>\n <td>127</td>\n <td>0.007874</td>\n </tr>\n <tr>\n <th>265</th>\n <td>2022</td>\n <td>Netherlands</td>\n <td>2</td>\n <td>5</td>\n <td>0.400000</td>\n </tr>\n <tr>\n <th>266</th>\n <td>2022</td>\n <td>Spain</td>\n <td>2</td>\n <td>5</td>\n <td>0.400000</td>\n </tr>\n <tr>\n <th>268</th>\n <td>2022</td>\n <td>Czechia</td>\n <td>1</td>\n <td>5</td>\n <td>0.200000</td>\n </tr>\n </tbody>\n</table>\n<p>231 rows × 5 columns</p>\n</div>"
},
"execution_count": 112,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data_eu = data[~data[\"Country\"].isin(ch_names)]\n",
"data_eu"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 121,
"outputs": [
{
"data": {
"text/plain": "Text(95.72222222222221, 0.5, '')"
},
"execution_count": 121,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/plain": "<Figure size 1000x1000 with 2 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0UAAANCCAYAAACpgmcNAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzddVhU2R/H8TdKmpioIIgomCCK2IW1a8ca2LV2JzY2BhZiJ3assea6rrX2otjdgFIGBinM7w9/js6KrjF4meH7ep55HubcO3c+Z24M595zzxioVCoVQgghhBBCCJFKpVE6gBBCCCGEEEIoSRpFQgghhBBCiFRNGkVCCCGEEEKIVE0aRUIIIYQQQohUTRpFQgghhBBCiFRNGkVCCCGEEEKIVE0aRUIIIYQQQohUTRpFQgghhBBCiFRNGkVCCCFShOT8LXH5nXIhhBCfI40iIUSK1LZtW4oUKcKlS5eSnO7m5oaHh8cPyeLh4YGbm9sPea+v8ebNGzw8PHB2dqZkyZKcOnVK6Ujf7K+//mLYsGHJsuyzZ8/StWvXZFm2EEII/SCNIiFEipWQkMDw4cOJi4tTOkqK9Pfff7Nt2zY6dOjAokWLKF68uNKRvtnKlSt5/Phxsix78+bN3LlzJ1mWLYQQQj9Io0gIkWJlzJiRW7du4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1EwaRUIInZA5c2Y8PT3p1asX8+fPT3Kef98YHhUVpbX3//DKxDvh4eFkzZoVeDtSnqurK0OHDk3y9V9zL9S7f/bDw8O
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(10,10))\n",
"g = sns.heatmap(pd.pivot_table(data_eu,columns=\"appln_filing_year\", index=\"Country\", values=\"count\").fillna(0).astype(int),\n",
" annot=True, fmt=\".0f\",linewidth=.5)\n",
"g.set_title(\"Number of co-patents per year\")\n",
"g.set_xlabel(\"\")\n",
"g.set_ylabel(\"\")"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 123,
"outputs": [
{
"data": {
"text/plain": "Text(95.72222222222221, 0.5, '')"
},
"execution_count": 123,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/plain": "<Figure size 1000x1000 with 2 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAz0AAANCCAYAAABMHKJhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzddVQU3RvA8S8oINiioNgFSiOl4mt3ix3Y3WJ3otiB3d3ti/GzCwQR7G5BRRHBQkCZ3x+8rK5LKssueD/nzDnszJ3Z5+HOzO7duXNHQ5IkCUEQBEEQBEEQhAxKU9UBCIIgCIIgCIIgKJNo9AiCIAiCIAiCkKGJRo8gCIIgCIIgCBmaaPQIgiAIgiAIgpChiUaPIAiCIAiCIAgZmmj0CIIgCIIgCIKQoYlGjyAIgiAIgiAIGZpo9AiCIAiCIAiCkKGJRo8gCCkinmesesqsg/RYv2kdc3r8HyVXRs5NEIS/m2j0CIKSuLi4YGJiIjeZm5tTtWpVJk+eTHh4uKpDTLGlS5eyZs0aVYeRYq9fv6Z9+/ZYWFhQoUIFIiIiVB3Sb1NmHezatYuZM2cqZdvJ4eLig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i6ukoVK1aUi+v9+/eSra2t5O7uLknSj0bP/Pnz5eKqXr261KtXL9nratWqydVn165dpS5dusits2nTJmn//v0J5hrffvrhwwfJ0tJSmjBhglzZnTt3SsbGxtL9+/clSZJv9Lx+/VpycXGR244kxe7b5ubmste/1u2FCxckY2NjydPTU269YcOGSU5OTlJ0dLQUHh4umZmZyf73cbp165Zoo+fXGCVJkmb
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.figure(figsize=(10,10))\n",
"g = sns.heatmap(pd.pivot_table(data_eu,columns=\"appln_filing_year\", index=\"Country\", values=\"percent\").fillna(0)*100,\n",
" annot=True, fmt=\".2f\",linewidth=.5)\n",
"g.set_title(\"Percentage of co-patents related to country per year\")\n",
"g.set_xlabel(\"\")\n",
"g.set_ylabel(\"\")"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
"source": [
"# Let's see about 'organizations'"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"# harmonized entities (sector and country too)"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 181,
"outputs": [],
"source": [
"pers_han = pers[[\"person_id\",\"han_id\",\"han_name\",\"psn_sector\",\"person_ctry_code\"]].drop_duplicates()\n",
"pers_han[\"psn_sector\"].fillna(\"UNKNOWN\", inplace=True)\n",
"pers_han = pers_han.sort_values(by=\"psn_sector\", ascending=True)\n",
"pers_han.drop(columns=\"person_id\", inplace=True)\n",
"pers_han = pers_han.groupby(\"han_id\", as_index=False)[[\"han_name\",\"psn_sector\",\"person_ctry_code\"]].agg(\n",
" lambda x: pd.Series.mode(x)[0])\n",
"pers_han = pers_han.merge(country_defs,left_on=\"person_ctry_code\",right_on=\"ctry_code\")"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 182,
"outputs": [
{
"data": {
"text/plain": " appln_id han_id han_name psn_sector Country\n0 352908776 1663881 L OREAL COMPANY France\n1 419627340 1663881 L OREAL COMPANY France\n2 422411429 1663881 L OREAL COMPANY France\n3 439807462 1663881 L OREAL COMPANY France\n4 441685575 1663881 L OREAL COMPANY France\n... ... ... ... ... ...\n87656 488889994 1590343 KERBEJ YUROP LTD COMPANY Malta\n87657 472247962 153591744 Van Rooij, Reinhart Cornelis UNKNOWN Latvia\n87658 505769448 157946198 VINGOVATOVS, Aleksejs UNKNOWN Latvia\n87659 481190056 3652317 VAVILOVS VALERIJS INDIVIDUAL Latvia\n87660 554759601 3652317 VAVILOVS VALERIJS INDIVIDUAL Latvia\n\n[87073 rows x 5 columns]",
"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>appln_id</th>\n <th>han_id</th>\n <th>han_name</th>\n <th>psn_sector</th>\n <th>Country</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>352908776</td>\n <td>1663881</td>\n <td>L OREAL</td>\n <td>COMPANY</td>\n <td>France</td>\n </tr>\n <tr>\n <th>1</th>\n <td>419627340</td>\n <td>1663881</td>\n <td>L OREAL</td>\n <td>COMPANY</td>\n <td>France</td>\n </tr>\n <tr>\n <th>2</th>\n <td>422411429</td>\n <td>1663881</td>\n <td>L OREAL</td>\n <td>COMPANY</td>\n <td>France</td>\n </tr>\n <tr>\n <th>3</th>\n <td>439807462</td>\n <td>1663881</td>\n <td>L OREAL</td>\n <td>COMPANY</td>\n <td>France</td>\n </tr>\n <tr>\n <th>4</th>\n <td>441685575</td>\n <td>1663881</td>\n <td>L OREAL</td>\n <td>COMPANY</td>\n <td>France</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>87656</th>\n <td>488889994</td>\n <td>1590343</td>\n <td>KERBEJ YUROP LTD</td>\n <td>COMPANY</td>\n <td>Malta</td>\n </tr>\n <tr>\n <th>87657</th>\n <td>472247962</td>\n <td>153591744</td>\n <td>Van Rooij, Reinhart Cornelis</td>\n <td>UNKNOWN</td>\n <td>Latvia</td>\n </tr>\n <tr>\n <th>87658</th>\n <td>505769448</td>\n <td>157946198</td>\n <td>VINGOVATOVS, Aleksejs</td>\n <td>UNKNOWN</td>\n <td>Latvia</td>\n </tr>\n <tr>\n <th>87659</th>\n <td>481190056</td>\n <td>3652317</td>\n <td>VAVILOVS VALERIJS</td>\n <td>INDIVIDUAL</td>\n <td>Latvia</td>\n </tr>\n <tr>\n <th>87660</th>\n <td>554759601</td>\n <td>3652317</td>\n <td>VAVILOVS VALERIJS</td>\n <td>INDIVIDUAL</td>\n <td>Latvia</td>\n </tr>\n </tbody>\n</table>\n<p>87073 rows × 5 columns</p>\n</div>"
},
"execution_count": 182,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"patstat_collabs = appln_pers.merge(pers, on=\"person_id\")\n",
"patstat_collabs = patstat_collabs.merge(country_defs, left_on=\"person_ctry_code\", right_on=\"ctry_code\")\n",
"org_collabs = patstat_collabs[[record_col,\"han_id\",\"han_name\",\"psn_sector\",\"Country\"]].drop_duplicates()\n",
"org_collabs[\"psn_sector\"].fillna(\"UNKNOWN\", inplace=True)\n",
"org_collabs"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 183,
"outputs": [
{
"data": {
"text/plain": " han_id count percent weight \n0 1337324 1980 0.092437 0.022740 \\\n1 62077 406 0.018954 0.004663 \n2 111166343 176 0.008217 0.002021 \n3 1912470 174 0.008123 0.001998 \n4 3697072 172 0.008030 0.001975 \n... ... ... ... ... \n21413 149475428 1 0.000047 0.000011 \n21414 149475432 1 0.000047 0.000011 \n21415 149475629 1 0.000047 0.000011 \n21416 149475736 1 0.000047 0.000011 \n21417 182805176 1 0.000047 0.000011 \n\n han_name psn_sector person_ctry_code \n0 HUAWEI TECH CO LTD COMPANY CN \\\n1 TAIWAN SEMICONDUCTOR MANUFACTURING CO LTD COMPANY TW \n2 Liu, Jinhua INDIVIDUAL CN \n3 MEDIATEK INC COMPANY TW \n4 NINGBO GEELY AUTOMOBILE R&D CO LTD COMPANY CN \n... ... ... ... \n21413 CHEN, Yuli UNKNOWN CN \n21414 CHEN, Zhi UNKNOWN CN \n21415 Du, Jun UNKNOWN CN \n21416 Chunlin, Wu UNKNOWN CN \n21417 Killine Optical Ltd UNKNOWN MO \n\n ctry_code iso_alpha3 Country organisation_flag \n0 CN CHN China \\\n1 TW TWN Taiwan Province Of China \n2 CN CHN China \n3 TW TWN Taiwan Province Of China \n4 CN CHN China \n... ... ... ... ... \n21413 CN CHN China \n21414 CN CHN China \n21415 CN CHN China \n21416 CN CHN China \n21417 MO MAC Macao SAR (China) \n\n continent eu_member epo_member oecd_member discontinued \n0 Asia \\\n1 Asia \n2 Asia \n3 Asia \n4 Asia \n... ... ... ... ... ... \n21413 Asia \n21414 Asia \n21415 Asia \n21416 Asia \n21417 Asia \n\n org \n0 HUAWEI TECH CO LTD (CN) \n1 TAIWAN SEMICONDUCTOR MANUFACTURING CO LTD (TW) \n2 Liu, Jinhua (CN) \n3 MEDIATEK INC (TW) \n4 NINGBO GEELY AUTOMOBILE R&D CO LTD (CN) \n... ... \n21413 CHEN, Yuli (CN) \n21414 CHEN, Zhi (CN) \n21415 Du, Jun (CN) \n21416 Chunlin, Wu (CN) \n21417 Killine Optical Ltd (MO) \n\n[21418 rows x 17 columns]",
"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>han_id</th>\n <th>count</th>\n <th>percent</th>\n <th>weight</th>\n <th>han_name</th>\n <th>psn_sector</th>\n <th>person_ctry_code</th>\n <th>ctry_code</th>\n <th>iso_alpha3</th>\n <th>Country</th>\n <th>organisation_flag</th>\n <th>continent</th>\n <th>eu_member</th>\n <th>epo_member</th>\n <th>oecd_member</th>\n <th>discontinued</th>\n <th>org</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>1337324</td>\n <td>1980</td>\n <td>0.092437</td>\n <td>0.022740</td>\n <td>HUAWEI TECH CO LTD</td>\n <td>COMPANY</td>\n <td>CN</td>\n <td>CN</td>\n <td>CHN</td>\n <td>China</td>\n <td></td>\n <td>Asia</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td>HUAWEI TECH CO LTD (CN)</td>\n </tr>\n <tr>\n <th>1</th>\n <td>62077</td>\n <td>406</td>\n <td>0.018954</td>\n <td>0.004663</td>\n <td>TAIWAN SEMICONDUCTOR MANUFACTURING CO LTD</td>\n <td>COMPANY</td>\n <td>TW</td>\n <td>TW</td>\n <td>TWN</td>\n <td>Taiwan Province Of China</td>\n <td></td>\n <td>Asia</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td>TAIWAN SEMICONDUCTOR MANUFACTURING CO LTD (TW)</td>\n </tr>\n <tr>\n <th>2</th>\n <td>111166343</td>\n <td>176</td>\n <td>0.008217</td>\n <td>0.002021</td>\n <td>Liu, Jinhua</td>\n <td>INDIVIDUAL</td>\n <td>CN</td>\n <td>CN</td>\n <td>CHN</td>\n <td>China</td>\n <td></td>\n <td>Asia</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td>Liu, Jinhua (CN)</td>\n </tr>\n <tr>\n <th>3</th>\n <td>1912470</td>\n <td>174</td>\n <td>0.008123</td>\n <td>0.001998</td>\n <td>MEDIATEK INC</td>\n <td>COMPANY</td>\n <td>TW</td>\n <td>TW</td>\n <td>TWN</td>\n <td>Taiwan Province Of China</td>\n <td></td>\n <td>Asia</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td>MEDIATEK INC (TW)</td>\n </tr>\n <tr>\n <th>4</th>\n <td>3697072</td>\n <td>172</td>\n <td>0.008030</td>\n <td>0.001975</td>\n <td>NINGBO GEELY AUTOMOBILE R&amp;D CO LTD</td>\n <td>COMPANY</td>\n <td>CN</td>\n <td>CN</td>\n <td>CHN</td>\n <td>China</td>\n <td></td>\n <td>Asia</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td>NINGBO GEELY AUTOMOBILE R&amp;D CO LTD (CN)</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>21413</th>\n <td>149475428</td>\n <td>1</td>\n <td>0.000047</td>\n <td>0.000011</td>\n <td>CHEN, Yuli</td>\n <td>UNKNOWN</td>\n <td>CN</td>\n <td>CN</td>\n <td>CHN</td>\n <td>China</td>\n <td></td>\n <td>Asia</td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td>CHEN, Yuli (CN)</td>\n </tr>\n <tr>\n <th>21414</th>\n <td>149475432</td>\n <td>1</td>\n <td>0.000047</td>\n <td>0.000011</td>\n <td>CHEN, Zhi</td>\n <td>UNKNOWN</td>\n <td>CN</td>\n <td>CN</td>\n <td>CHN</td>\n <td>China</td>\n
},
"execution_count": 183,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# China\n",
"org_collabs_ch = org_collabs[org_collabs[\"Country\"].isin(ch_names)][\"han_id\"].value_counts().reset_index()\n",
"org_collabs_ch[\"percent\"] = org_collabs_ch[\"count\"]/org_collabs[record_col].nunique()\n",
"org_collabs_ch[\"weight\"] = org_collabs_ch[\"count\"]/org_collabs[record_col].size\n",
"org_collabs_ch = org_collabs_ch.merge(pers_han, on='han_id')\n",
"org_collabs_ch[\"org\"] = org_collabs_ch[\"han_name\"].str.strip() + \" (\"+org_collabs_ch[\"person_ctry_code\"]+\")\"\n",
"org_collabs_ch"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 184,
"outputs": [
{
"data": {
"text/plain": "<matplotlib.legend.Legend at 0x24295d9dd00>"
},
"execution_count": 184,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA48AAAGwCAYAAAAJ2lBeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdeVzN2f/A8ddtUymFSijZMy1MyTbDoDAz1rGvhQxjy5qdsY1hbIOy77LMWJKdKMswJoMIg/kaDFmyVUpo/f3R736m695S9uX9fDx6TPec8/l8zvncT+O+79lUGRkZGQghhBBCCCGEEDnQe9sVEEIIIYQQQgjx7pPgUQghhBBCCCHEc0nwKIQQQgghhBDiuSR4FEIIIYQQQgjxXBI8CiGEEEIIIYR4LgkehRBCCCGEEEI8lwSPQgghhBBCCCGeS4JHIYQQQgghhBDPJcGjEEIIIYQQQojnMnjbFRBCCPH+iY199Lar8MYULJj/o2nvx9RWkPZ+yD6mtoK090OSkZFBenoGACkpyXTv3pn+/Qfj5uYBwIUL55k5cyqXL1+iVKky9O8/GBcXV+X4zZs3snZtEHFxcbi6VmTw4GEUL26HSgWFCpkxY8YMNm7cSHp6Oq1atcLf3x89vdz3J0rwKIQQIs8KFsz/tqvwRn1M7f2Y2grS3g/Zx9RWkPZ+KNLS0omLS+Lx4yeMHz+a//3vf2RkQEYGxMY+oH//XtStW5+RI8fyxx9HGDCgD0FB67G1tSUi4ijz5gUwduwP2NuXYOHCQEaMGMLKlesAWL58Odu3bycwMJDU1FSGDBlC4cKF6datW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5s3KqlweHh5ERUVRp04dYmJicHd3V8ru3r2b+Ph4rl69qjEZG+CHH36gUqVKGmnGxsYv0XJtuu5F1vZZWloSHx+fq3O5uLgwffp0rfSchrbm9vwWFhbK/6yflZqayoMHD166FzSvHj16hJmZ2Ru9phBCCCHy5uTJ42zZsonx4ydjZWVFRkYGf/zxO82atQTAysqaq1cvU736Z0Bmz+KtWzcpWrQ41tbWFCtWjBMnTijB44kTJyhWrFiu5zuCBI9CvNcKFy6Mg4ODVlpW5ubmJCYmah37bE/Zjh07ePLkicZCN2lpaezevZsxY8ZgbGyMh4cHU6ZM4c8//8TFxUUZ5lC1alWmTZtGZGQkpUuX1lpFtUiRIlr1fNV03YusnJ2dOXfunM68mTNnUrhwYTp37gxkBrZ5rW9uz1+xYsVsy50/f560tLRsh7W+DtHR0SQmJmrNwRRCCCHEu8XevgRHjvzG5s0bqVq1OuvWrSYhIYGvv24MQJMm37Bq1XLs7R2wt7dn1arlmJjkV7buaN++PdOnT8fW1haAGTNmKKuz55bMeRTiA+fo6EhkZKRW+unTp3FycgLgypUr/PXXX4wePZqQkBDl5+effyYxMZG9e/cC4ObmxrVr1zS25gAoV64cpqambNu2japVq76ZhuVR06ZN2bdvH9evX9dIj4mJYc2aNRq9lK/z/G3btiUsLExnABkYGIizs7PyvrwJmzZtwtraWuldFkIIIcS7ydrahgkTprBx4y907tyO69f/ZdaseZiamgLQvr037dt7M2vWdLp370xsbCyzZs1VVlPv1q0bDRs2pG/fvvTv359mzZrRpUuXPNVBeh6F+MC1b9+e9u3bM3/+fBo2bMiTJ0/Yu3cv+/fv59dffwUyex0tLS1p27atxipc5cuXZ+7cuYSEhNCkSRPMzMwoV64cu3fvZu7cuUo59bzHsLAwfvzxR606xMfH6xyqWaBAgVe2PURCQoLOa+TPnx9TU1MaNmxIcHAwnTt3ZsiQIbi4uHD58mWmTZtGmTJlaNWq1UtdP7fnr1u3Lm3atKFHjx7
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = org_collabs_ch[0:25]\n",
"g = sns.barplot(data, x=\"count\", y=\"han_name\", hue=\"psn_sector\", dodge=False)\n",
"g.set_ylabel(\"Entity\")\n",
"g.set_xlabel(\"Number of co-patents\")\n",
"for i in g.containers:\n",
" g.bar_label(i,)\n",
"g.legend(title=None)"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 185,
"outputs": [
{
"data": {
"text/plain": "<matplotlib.legend.Legend at 0x24285bfa8b0>"
},
"execution_count": 185,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA48AAAGwCAYAAAAJ2lBeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd1RUx9vA8e/SBARBBUQFsWMoGhBrNCqoSey9g4rR2LASu7HFaGxRwd7BklgQY0fBEo3BqChq1PyMGjs2QBCV+v7BuzesuyDYy/M5hxN2Zu69M3cvcZ+dpsrIyMhACCGEEEIIIYTIgd7broAQQgghhBBCiHefBI9CCCGEEEIIIZ5LgkchhBBCCCGEEM8lwaMQQgghhBBCiOeS4FEIIYQQQgghxHNJ8CiEEEIIIYQQ4rkkeBRCCCGEEEII8VwSPAohhBBCCCGEeC4JHoUQQgghhBBCPJfB266AEEKI909s7KO3XYU3pmDB/B9Nez+mtoK090P2MbUVpL0fkoyMDNLTMwBISUmmZ8+uDBw4FDc3DwDOnz/HrFnTuHTpIqVKlWHgwKG4uLgqx2/evJG1a4OJi4vD1bUiQ4cOp3hxO1QqKFTIjJkzZ7Jx40bS09Np06YN/v7+6Onlvj9RgkchhBB5VrBg/rddhTfqY2rvx9RWkPZ+yD6mtoK090ORlpZOXFwSjx8/YcKEMfzvf/8jIwMyMiA29gEDB/ahXr0GjBo1jj/+OMyg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VC39
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"g = sns.barplot(data, x=\"count\", y=\"han_name\", hue=\"Country\", dodge=False)\n",
"g.set_ylabel(\"Entity\")\n",
"g.set_xlabel(\"Number of co-patents\")\n",
"for i in g.containers:\n",
" g.bar_label(i,)\n",
"g.legend(title=None, loc=4)"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 186,
"outputs": [
{
"data": {
"text/plain": " han_id count percent weight han_name \n0 13378 1821 0.085014 0.020913 TELEFON AB LM ERICSSON PUBL \\\n1 68848 471 0.021989 0.005409 ALCATEL LUCENT \n2 2562294 445 0.020775 0.005111 NOKIA TECH LTD \n3 228842 403 0.018814 0.004628 BASF SE \n4 2125445 372 0.017367 0.004272 NOKIA CORP \n... ... ... ... ... ... \n19100 107891047 1 0.000047 0.000011 Goldacker, Thorsten \n19101 176254977 1 0.000047 0.000011 Dietrich, Tiantian \n19102 176256380 1 0.000047 0.000011 LAJFELD Ferdinand \n19103 176327671 1 0.000047 0.000011 GALEANO Karolina \n19104 174748097 1 0.000047 0.000011 Chen, Yunzheng \n\n psn_sector person_ctry_code ctry_code iso_alpha3 Country \n0 COMPANY SE SE SWE Sweden \\\n1 COMPANY FR FR FRA France \n2 COMPANY FI FI FIN Finland \n3 COMPANY DE DE DEU Germany \n4 COMPANY FI FI FIN Finland \n... ... ... ... ... ... \n19100 INDIVIDUAL DE DE DEU Germany \n19101 UNKNOWN DE DE DEU Germany \n19102 UNKNOWN DE DE DEU Germany \n19103 UNKNOWN DE DE DEU Germany \n19104 UNKNOWN DE DE DEU Germany \n\n organisation_flag continent eu_member epo_member oecd_member \n0 Europe Y Y Y \\\n1 Europe Y Y Y \n2 Europe Y Y Y \n3 Europe Y Y Y \n4 Europe Y Y Y \n... ... ... ... ... ... \n19100 Europe Y Y Y \n19101 Europe Y Y Y \n19102 Europe Y Y Y \n19103 Europe Y Y Y \n19104 Europe Y Y Y \n\n discontinued \n0 \n1 \n2 \n3 \n4 \n... ... \n19100 \n19101 \n19102 \n19103 \n19104 \n\n[19105 rows x 16 columns]",
"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>han_id</th>\n <th>count</th>\n <th>percent</th>\n <th>weight</th>\n <th>han_name</th>\n <th>psn_sector</th>\n <th>person_ctry_code</th>\n <th>ctry_code</th>\n <th>iso_alpha3</th>\n <th>Country</th>\n <th>organisation_flag</th>\n <th>continent</th>\n <th>eu_member</th>\n <th>epo_member</th>\n <th>oecd_member</th>\n <th>discontinued</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>13378</td>\n <td>1821</td>\n <td>0.085014</td>\n <td>0.020913</td>\n <td>TELEFON AB LM ERICSSON PUBL</td>\n <td>COMPANY</td>\n <td>SE</td>\n <td>SE</td>\n <td>SWE</td>\n <td>Sweden</td>\n <td></td>\n <td>Europe</td>\n <td>Y</td>\n <td>Y</td>\n <td>Y</td>\n <td></td>\n </tr>\n <tr>\n <th>1</th>\n <td>68848</td>\n <td>471</td>\n <td>0.021989</td>\n <td>0.005409</td>\n <td>ALCATEL LUCENT</td>\n <td>COMPANY</td>\n <td>FR</td>\n <td>FR</td>\n <td>FRA</td>\n <td>France</td>\n <td></td>\n <td>Europe</td>\n <td>Y</td>\n <td>Y</td>\n <td>Y</td>\n <td></td>\n </tr>\n <tr>\n <th>2</th>\n <td>2562294</td>\n <td>445</td>\n <td>0.020775</td>\n <td>0.005111</td>\n <td>NOKIA TECH LTD</td>\n <td>COMPANY</td>\n <td>FI</td>\n <td>FI</td>\n <td>FIN</td>\n <td>Finland</td>\n <td></td>\n <td>Europe</td>\n <td>Y</td>\n <td>Y</td>\n <td>Y</td>\n <td></td>\n </tr>\n <tr>\n <th>3</th>\n <td>228842</td>\n <td>403</td>\n <td>0.018814</td>\n <td>0.004628</td>\n <td>BASF SE</td>\n <td>COMPANY</td>\n <td>DE</td>\n <td>DE</td>\n <td>DEU</td>\n <td>Germany</td>\n <td></td>\n <td>Europe</td>\n <td>Y</td>\n <td>Y</td>\n <td>Y</td>\n <td></td>\n </tr>\n <tr>\n <th>4</th>\n <td>2125445</td>\n <td>372</td>\n <td>0.017367</td>\n <td>0.004272</td>\n <td>NOKIA CORP</td>\n <td>COMPANY</td>\n <td>FI</td>\n <td>FI</td>\n <td>FIN</td>\n <td>Finland</td>\n <td></td>\n <td>Europe</td>\n <td>Y</td>\n <td>Y</td>\n <td>Y</td>\n <td></td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>19100</th>\n <td>107891047</td>\n <td>1</td>\n <td>0.000047</td>\n <td>0.000011</td>\n <td>Goldacker, Thorsten</td>\n <td>INDIVIDUAL</td>\n <td>DE</td>\n <td>DE</td>\n <td>DEU</td>\n <td>Germany</td>\n <td></td>\n <td>Europe</td>\n <td>Y</td>\n <td>Y</td>\n <td>Y</td>\n <td></td>\n </tr>\n <tr>\n <th>19101</th>\n <td>176254977</td>\n <td>1</td>\n <td>0.000047</td>\n <td>0.000011</td>\n <td>Dietrich, Tiantian</td>\n <td>UNKNOWN</td>\n <td>DE</td>\n <td>DE</td>\n <td>DEU</td>\n <td>Germany</td>\n <td></td>\n <td>Europe</td>\n <td>Y</td>\n <td>Y</td>\n <td>Y</td>\n <td></td>\n </tr>\n <tr>\n <th>19102</th>\n <td>176256380</td>\n <td>1</td>\n <td>0.000047</td>\n <td>0.000011</td>\n <td>LAJFELD Ferdinand</td>\n <td>UNKNOWN</td>\n <td>DE</td>\n <td>DE
},
"execution_count": 186,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Eu\n",
"org_collabs_eu = org_collabs[~org_collabs[\"Country\"].isin(ch_names)][\"han_id\"].value_counts().reset_index()\n",
"org_collabs_eu[\"percent\"] = org_collabs_eu[\"count\"]/org_collabs[record_col].nunique()\n",
"org_collabs_eu[\"weight\"] = org_collabs_eu[\"count\"]/org_collabs[record_col].size\n",
"org_collabs_eu = org_collabs_eu.merge(pers_han, on='han_id')\n",
"org_collabs_eu"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 187,
"outputs": [
{
"data": {
"text/plain": "<matplotlib.legend.Legend at 0x2429909cf40>"
},
"execution_count": 187,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAwkAAAGwCAYAAADiwSkYAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdeVzN2f/A8VclIu0rbbYREZPI2hfZKWaSQabQ2CVbxhIKZd9ryL4kM2Mro6Qky9c+2bPkawyyS0KR6N7fH/36jOvekp1xno/HfTzc8znnfM7n3IvP+37OoiaXy+UIgiAIgiAIgiD8P/VP3QBBEARBEARBED4vIkgQBEEQBEEQBEGBCBIEQRAEQRAEQVAgggRBEARBEARBEBSIIEEQBEEQBEEQBAUiSBAEQRAEQRAEQYEIEgRBEARBEARBUCCCBEEQBEEQBEEQFIggQRAEQRAEQRAEBSU+dQMEQfi8PXiQ/amb8EkZGGiLPhB9IPoA0Qdf+/WD6AN4v30gl8uRyeQA5Obm4uPzIyNG/EydOnUBOHnyBAsXzuHq1StYWlrj6zuUevXqS2UjI9cQHb2Fhw8fUr26HcOHj6JixUqoqYGRkY6U76effsLV1RV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a1dovfr6+jx69KhYbTc3N2fy5MkEBQVx9uxZ4uPjiYiIYPz48SxevBjID4QGDRrEoEGDuHbtGrt372blypUMHDiQ3bt3f5TPuEDB90xdXZ2yZctiYGCgcLxEiRLIZMrjE2UymbTCUoHg4GBpcvaDBw9Yt24d3bt3Z9u2bW/0d0QQBEEQhM+HsbEJV65cVki7evUK5crl/3B
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data = org_collabs_eu[0:25]\n",
"g = sns.barplot(data, x=\"count\", y=\"han_name\", hue=\"psn_sector\", dodge=False)\n",
"g.set_ylabel(\"Entity\")\n",
"g.set_xlabel(\"Number of co-patents\")\n",
"for i in g.containers:\n",
" g.bar_label(i,)\n",
"g.legend(title=None)"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 188,
"outputs": [
{
"data": {
"text/plain": "<matplotlib.legend.Legend at 0x2429b918ca0>"
},
"execution_count": 188,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAwkAAAGwCAYAAADiwSkYAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdeVzN2f/A8VclUtpX2mwjIiaRtS+yU5lJBplCM/Zky1hCWbLvNWRfkpmxlVESyfJlLJM9S77GUHZRKBLd+/ujX59x3VuyM87z8biPh3s+55zP+Zx78Xnfz1nU5HK5HEEQBEEQBEEQhP+n/rEbIAiCIAiCIAjCp0UECYIgCIIgCIIgKBBBgiAIgiAIgiAICkSQIAiCIAiCIAiCAhEkCIIgCIIgCIKgQAQJgiAIgiAIgiAoEEGCIAiCIAiCIAgKRJAgCIIgCIIgCIICESQIgiAIgiAIgqCg1MdugCAIn7bMzJyP3YSPytBQR/SB6APRB4g++NKv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VatWMWzYMBITE2nWrFmJhr+4uroSGBiolF74S3/hnyMjI5HL5Zw6dYqpU6fSuXNn2rdvX2S9BgYGPHz4sERtt7CwYNKkSYSEhHD27FkSEhKIjIxk3LhxLF68GCgIhAYOHMjAgQNJS0tjz549rFy5kgEDBrBnz54P8hkXKvyeqaurU65cOQwNDRWOlypVCplMeXyiTCaTVlgqNGXKFGlydmZmJuvWraN79+5s27bttf6OCIIgCILw6TAxMeXKlcsKaVevXqF8+YI
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"g = sns.barplot(data, x=\"count\", y=\"han_name\", hue=\"Country\", dodge=False)\n",
"g.set_ylabel(\"Entity\")\n",
"g.set_xlabel(\"Number of co-patents\")\n",
"for i in g.containers:\n",
" g.bar_label(i,)\n",
"g.legend(title=None, loc=4)"
],
"metadata": {
"collapsed": false
}
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}