additional university name harmonization

utku_inst_name_exploration
radvanyimome 1 year ago
parent 7ad4a02854
commit f68e35632b

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 23, "execution_count": 191,
"outputs": [], "outputs": [],
"source": [ "source": [
"import pandas as pd\n", "import pandas as pd\n",
@ -23,7 +23,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": 192,
"outputs": [], "outputs": [],
"source": [ "source": [
"def wikinorm(univ_string):\n", "def wikinorm(univ_string):\n",
@ -43,7 +43,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 68, "execution_count": 193,
"outputs": [], "outputs": [],
"source": [ "source": [
"def replace_uppercase_words(text):\n", "def replace_uppercase_words(text):\n",
@ -66,7 +66,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 69, "execution_count": 194,
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
@ -85,7 +85,7 @@
"application/vnd.jupyter.widget-view+json": { "application/vnd.jupyter.widget-view+json": {
"version_major": 2, "version_major": 2,
"version_minor": 0, "version_minor": 0,
"model_id": "ee2cde76498b4a46a2e87ea6c971aed9" "model_id": "8551fdcfc52a43108a78c1e91915c681"
} }
}, },
"metadata": {}, "metadata": {},
@ -115,14 +115,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 39, "execution_count": 195,
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": " UT (Unique WOS ID) Institution Country \n84810 WOS:000571399800004 Univ Birmingham United Kingdom \\\n122264 WOS:000732918800001 Univ Southampton United Kingdom \n135675 WOS:000799234000004 UCL United Kingdom \n153134 WOS:000900724501058 Kore Univ Enna Italy \n51445 WOS:000455277600005 Univ Sheffield United Kingdom \n... ... ... ... \n21043 WOS:000372583700005 Vrije Univ Amsterdam Netherlands \n1938 WOS:000297611600011 Univ Essex United Kingdom \n64691 WOS:000490430500091 Xian Jiaotong Liverpool Univ China \n25740 WOS:000386793200001 Chinese Acad Sci China \n112682 WOS:000696110800001 Dalian Univ Technol China \n\n Institution_harm \n84810 Univ Birmingham \n122264 Univ Southampton \n135675 UCL \n153134 Kore Univ Enna \n51445 Univ Sheffield \n... ... \n21043 Vrije Univ Amsterdam \n1938 Univ Essex \n64691 Xian Jiaotong Liverpool Univ \n25740 Chinese Acad Sci \n112682 Dalian Univ Technol \n\n[100 rows x 4 columns]", "text/plain": " UT (Unique WOS ID) Institution \n1094 WOS:000292330300050 Hong Kong Polytech Univ \\\n21547 WOS:000374363900001 Guangdong Univ Technol \n53778 WOS:000459846300019 Aarhus Univ \n153776 WOS:000907044000014 Univ Siena \n81562 WOS:000554591602038 China Natl Elect Import Export Corp \n... ... ... \n29206 WOS:000397047200002 Univ Duisburg Essen \n21658 WOS:000374617600020 Univ Southampton \n43289 WOS:000434742800004 Univ Strathclyde \n37200 WOS:000418525100013 Goethe Univ Frankfurt \n95964 WOS:000616310200013 Eindhoven Univ Technol \n\n Country Institution_harm \n1094 China Hong Kong Polytech Univ \n21547 China Guangdong Univ Technol \n53778 Denmark Aarhus Univ \n153776 Italy Univ Siena \n81562 China China Natl Elect Import Export Corp \n... ... ... \n29206 Germany Univ Duisburg Essen \n21658 United Kingdom Univ Southampton \n43289 United Kingdom Univ Strathclyde \n37200 Germany Goethe Univ Frankfurt \n95964 Netherlands Eindhoven Univ Technol \n\n[100 rows x 4 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>UT (Unique WOS ID)</th>\n <th>Institution</th>\n <th>Country</th>\n <th>Institution_harm</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>84810</th>\n <td>WOS:000571399800004</td>\n <td>Univ Birmingham</td>\n <td>United Kingdom</td>\n <td>Univ Birmingham</td>\n </tr>\n <tr>\n <th>122264</th>\n <td>WOS:000732918800001</td>\n <td>Univ Southampton</td>\n <td>United Kingdom</td>\n <td>Univ Southampton</td>\n </tr>\n <tr>\n <th>135675</th>\n <td>WOS:000799234000004</td>\n <td>UCL</td>\n <td>United Kingdom</td>\n <td>UCL</td>\n </tr>\n <tr>\n <th>153134</th>\n <td>WOS:000900724501058</td>\n <td>Kore Univ Enna</td>\n <td>Italy</td>\n <td>Kore Univ Enna</td>\n </tr>\n <tr>\n <th>51445</th>\n <td>WOS:000455277600005</td>\n <td>Univ Sheffield</td>\n <td>United Kingdom</td>\n <td>Univ Sheffield</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>21043</th>\n <td>WOS:000372583700005</td>\n <td>Vrije Univ Amsterdam</td>\n <td>Netherlands</td>\n <td>Vrije Univ Amsterdam</td>\n </tr>\n <tr>\n <th>1938</th>\n <td>WOS:000297611600011</td>\n <td>Univ Essex</td>\n <td>United Kingdom</td>\n <td>Univ Essex</td>\n </tr>\n <tr>\n <th>64691</th>\n <td>WOS:000490430500091</td>\n <td>Xian Jiaotong Liverpool Univ</td>\n <td>China</td>\n <td>Xian Jiaotong Liverpool Univ</td>\n </tr>\n <tr>\n <th>25740</th>\n <td>WOS:000386793200001</td>\n <td>Chinese Acad Sci</td>\n <td>China</td>\n <td>Chinese Acad Sci</td>\n </tr>\n <tr>\n <th>112682</th>\n <td>WOS:000696110800001</td>\n <td>Dalian Univ Technol</td>\n <td>China</td>\n <td>Dalian Univ Technol</td>\n </tr>\n </tbody>\n</table>\n<p>100 rows × 4 columns</p>\n</div>" "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>UT (Unique WOS ID)</th>\n <th>Institution</th>\n <th>Country</th>\n <th>Institution_harm</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>1094</th>\n <td>WOS:000292330300050</td>\n <td>Hong Kong Polytech Univ</td>\n <td>China</td>\n <td>Hong Kong Polytech Univ</td>\n </tr>\n <tr>\n <th>21547</th>\n <td>WOS:000374363900001</td>\n <td>Guangdong Univ Technol</td>\n <td>China</td>\n <td>Guangdong Univ Technol</td>\n </tr>\n <tr>\n <th>53778</th>\n <td>WOS:000459846300019</td>\n <td>Aarhus Univ</td>\n <td>Denmark</td>\n <td>Aarhus Univ</td>\n </tr>\n <tr>\n <th>153776</th>\n <td>WOS:000907044000014</td>\n <td>Univ Siena</td>\n <td>Italy</td>\n <td>Univ Siena</td>\n </tr>\n <tr>\n <th>81562</th>\n <td>WOS:000554591602038</td>\n <td>China Natl Elect Import Export Corp</td>\n <td>China</td>\n <td>China Natl Elect Import Export Corp</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>29206</th>\n <td>WOS:000397047200002</td>\n <td>Univ Duisburg Essen</td>\n <td>Germany</td>\n <td>Univ Duisburg Essen</td>\n </tr>\n <tr>\n <th>21658</th>\n <td>WOS:000374617600020</td>\n <td>Univ Southampton</td>\n <td>United Kingdom</td>\n <td>Univ Southampton</td>\n </tr>\n <tr>\n <th>43289</th>\n <td>WOS:000434742800004</td>\n <td>Univ Strathclyde</td>\n <td>United Kingdom</td>\n <td>Univ Strathclyde</td>\n </tr>\n <tr>\n <th>37200</th>\n <td>WOS:000418525100013</td>\n <td>Goethe Univ Frankfurt</td>\n <td>Germany</td>\n <td>Goethe Univ Frankfurt</td>\n </tr>\n <tr>\n <th>95964</th>\n <td>WOS:000616310200013</td>\n <td>Eindhoven Univ Technol</td>\n <td>Netherlands</td>\n <td>Eindhoven Univ Technol</td>\n </tr>\n </tbody>\n</table>\n<p>100 rows × 4 columns</p>\n</div>"
}, },
"execution_count": 39, "execution_count": 195,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -136,14 +136,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 71, "execution_count": 196,
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": " Country Institution_harm \n7736 France Yncrea Ouest \\\n13752 Spain Univ Carlos \n15855 United Kingdom Northumbria Univ Newcastle Upon Tyne \n12514 Norway Nord Univ \n602 China Henan Polytech Univ \n... ... ... \n11620 Italy Deep Blue Srl \n11183 Italy Univ Giustino Fortunato \n7433 Estonia Platinum Software Dev Co \n5129 China State & Local Joint Engn Lab Estuarine Hydraul Te \n6799 China MOA \n\n count \n7736 9 \n13752 1 \n15855 1 \n12514 1 \n602 87 \n... ... \n11620 1 \n11183 3 \n7433 1 \n5129 1 \n6799 1 \n\n[100 rows x 3 columns]", "text/plain": " Country Institution_harm count\n12655 Poland Space Res Ctr 6\n12940 Portugal Ctr Invest Energia State Grid 1\n616 China Minist Nat Resources 78\n5561 China PowerChina Huadong Engn Corp Ltd 1\n514 China Chongqing Univ 478\n... ... ... ...\n476 Bulgaria Tech Univ 1\n12454 Norway Stavanger Univ Hosp 9\n5489 China Shanghai Sports Sch 1\n768 China Hubei Univ 25\n13527 Spain Jimenez Diaz Univ Hosp 2\n\n[100 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>Country</th>\n <th>Institution_harm</th>\n <th>count</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>7736</th>\n <td>France</td>\n <td>Yncrea Ouest</td>\n <td>9</td>\n </tr>\n <tr>\n <th>13752</th>\n <td>Spain</td>\n <td>Univ Carlos</td>\n <td>1</td>\n </tr>\n <tr>\n <th>15855</th>\n <td>United Kingdom</td>\n <td>Northumbria Univ Newcastle Upon Tyne</td>\n <td>1</td>\n </tr>\n <tr>\n <th>12514</th>\n <td>Norway</td>\n <td>Nord Univ</td>\n <td>1</td>\n </tr>\n <tr>\n <th>602</th>\n <td>China</td>\n <td>Henan Polytech Univ</td>\n <td>87</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>11620</th>\n <td>Italy</td>\n <td>Deep Blue Srl</td>\n <td>1</td>\n </tr>\n <tr>\n <th>11183</th>\n <td>Italy</td>\n <td>Univ Giustino Fortunato</td>\n <td>3</td>\n </tr>\n <tr>\n <th>7433</th>\n <td>Estonia</td>\n <td>Platinum Software Dev Co</td>\n <td>1</td>\n </tr>\n <tr>\n <th>5129</th>\n <td>China</td>\n <td>State &amp; Local Joint Engn Lab Estuarine Hydraul Te</td>\n <td>1</td>\n </tr>\n <tr>\n <th>6799</th>\n <td>China</td>\n <td>MOA</td>\n <td>1</td>\n </tr>\n </tbody>\n</table>\n<p>100 rows × 3 columns</p>\n</div>" "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>Institution_harm</th>\n <th>count</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>12655</th>\n <td>Poland</td>\n <td>Space Res Ctr</td>\n <td>6</td>\n </tr>\n <tr>\n <th>12940</th>\n <td>Portugal</td>\n <td>Ctr Invest Energia State Grid</td>\n <td>1</td>\n </tr>\n <tr>\n <th>616</th>\n <td>China</td>\n <td>Minist Nat Resources</td>\n <td>78</td>\n </tr>\n <tr>\n <th>5561</th>\n <td>China</td>\n <td>PowerChina Huadong Engn Corp Ltd</td>\n <td>1</td>\n </tr>\n <tr>\n <th>514</th>\n <td>China</td>\n <td>Chongqing Univ</td>\n <td>478</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>476</th>\n <td>Bulgaria</td>\n <td>Tech Univ</td>\n <td>1</td>\n </tr>\n <tr>\n <th>12454</th>\n <td>Norway</td>\n <td>Stavanger Univ Hosp</td>\n <td>9</td>\n </tr>\n <tr>\n <th>5489</th>\n <td>China</td>\n <td>Shanghai Sports Sch</td>\n <td>1</td>\n </tr>\n <tr>\n <th>768</th>\n <td>China</td>\n <td>Hubei Univ</td>\n <td>25</td>\n </tr>\n <tr>\n <th>13527</th>\n <td>Spain</td>\n <td>Jimenez Diaz Univ Hosp</td>\n <td>2</td>\n </tr>\n </tbody>\n</table>\n<p>100 rows × 3 columns</p>\n</div>"
}, },
"execution_count": 71, "execution_count": 196,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -159,7 +159,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 72, "execution_count": 197,
"outputs": [], "outputs": [],
"source": [ "source": [
"# from pandarallel import pandarallel\n", "# from pandarallel import pandarallel\n",
@ -173,27 +173,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 73, "execution_count": 198,
"outputs": [
{
"data": {
"text/plain": "['Austria', 'Belgium']"
},
"execution_count": 73,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"list(univ_norm[\"Country\"].unique())[0:2]"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 95,
"outputs": [], "outputs": [],
"source": [ "source": [
"def ngrams(string, n=3):\n", "def ngrams(string, n=3):\n",
@ -296,26 +276,27 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 130, "execution_count": 199,
"outputs": [ "outputs": [
{ {
"name": "stderr", "name": "stderr",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"30it [00:00, 53.27it/s]\n" "100%|██████████| 31/31 [00:00<00:00, 32.89it/s]\n"
] ]
} }
], ],
"source": [ "source": [
"merger = pd.DataFrame()\n", "merger = pd.DataFrame()\n",
"\n", "\n",
"for i in tqdm(filter(lambda c: c!=\"China\", list(univ_norm[\"Country\"].unique()))):\n", "# for i in tqdm(filter(lambda c: c!=\"China\", list(univ_norm[\"Country\"].unique()))):\n",
"for i in tqdm(list(univ_norm[\"Country\"].unique())):\n",
" sub_inst = univ_norm[univ_norm[\"Country\"]==i].reset_index()\n", " sub_inst = univ_norm[univ_norm[\"Country\"]==i].reset_index()\n",
" types = sub_inst['Institution_harm']\n", " types = sub_inst['Institution_harm']\n",
" vectorizer = TfidfVectorizer(min_df=1, analyzer=ngrams)\n", " vectorizer = TfidfVectorizer(min_df=1, analyzer=ngrams)\n",
" tf_idf_matrix = vectorizer.fit_transform(types)\n", " tf_idf_matrix = vectorizer.fit_transform(types)\n",
" t1 = time.time()\n", " t1 = time.time()\n",
" matches = awesome_cossim_top(tf_idf_matrix, tf_idf_matrix.transpose(), 10, 0.8)\n", " matches = awesome_cossim_top(tf_idf_matrix, tf_idf_matrix.transpose(), 10, 0.8 if i!=\"China\" else 0.9)\n",
" t = time.time()-t1\n", " t = time.time()-t1\n",
"\n", "\n",
" # store the matches into new dataframe called matched_df and printing 10 samples\n", " # store the matches into new dataframe called matched_df and printing 10 samples\n",
@ -353,20 +334,20 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 131, "execution_count": 200,
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"1192\n" "1538\n"
] ]
}, },
{ {
"name": "stderr", "name": "stderr",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"1192it [00:44, 26.68it/s]\n" "1538it [01:04, 23.79it/s]\n"
] ]
} }
], ],
@ -387,6 +368,27 @@
"collapsed": false "collapsed": false
} }
}, },
{
"cell_type": "code",
"execution_count": 201,
"outputs": [
{
"data": {
"text/plain": " Country low_side \n0 China Logist Univ Chinese Peoples Armed Police Forces \\\n9 China Flight Automat Control Res Inst \n10 China Northwest Elect Power Design Inst Co Ltd \n11 China Northwest Elect Power Design Inst Co Ltd China \n12 China Northwest Inst Ecoenvironm & Resources \n... ... ... \n1531 China Chinese Univ Hong Kong Hong \n1532 China Huazhong Univ Sci & Techno \n1533 China Hong Kong Polytech Univ Hong Kong \n1534 China Kong Kong Polytech Univ \n1537 China Univ Elect Sci & Technol Chin \n\n high_side high_count \n0 Logist Univ Chinese Peoples Armed Police Force 1 \\\n9 Xian Flight Automat Control Res Inst 1 \n10 Northwest Elect Power Design Inst Co Ltd China 1 \n11 Northwest Elect Power Design Inst Co Ltd 1 \n12 Northwest Inst Ecoenvironm & Resources Chinese Ac 1 \n... ... ... \n1531 Chinese Univ Hong Kong 728 \n1532 Huazhong Univ Sci & Technol 729 \n1533 Hong Kong Polytech Univ 809 \n1534 Hong Kong Polytech Univ 809 \n1537 Univ Elect Sci & Technol China 1076 \n\n low_count similarity \n0 1 0.988072 \n9 1 0.905747 \n10 1 0.926984 \n11 1 0.926984 \n12 1 0.910630 \n... ... ... \n1531 1 0.935944 \n1532 1 0.989260 \n1533 1 0.917345 \n1534 1 0.939416 \n1537 1 0.983258 \n\n[346 rows x 6 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>Country</th>\n <th>low_side</th>\n <th>high_side</th>\n <th>high_count</th>\n <th>low_count</th>\n <th>similarity</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>China</td>\n <td>Logist Univ Chinese Peoples Armed Police Forces</td>\n <td>Logist Univ Chinese Peoples Armed Police Force</td>\n <td>1</td>\n <td>1</td>\n <td>0.988072</td>\n </tr>\n <tr>\n <th>9</th>\n <td>China</td>\n <td>Flight Automat Control Res Inst</td>\n <td>Xian Flight Automat Control Res Inst</td>\n <td>1</td>\n <td>1</td>\n <td>0.905747</td>\n </tr>\n <tr>\n <th>10</th>\n <td>China</td>\n <td>Northwest Elect Power Design Inst Co Ltd</td>\n <td>Northwest Elect Power Design Inst Co Ltd China</td>\n <td>1</td>\n <td>1</td>\n <td>0.926984</td>\n </tr>\n <tr>\n <th>11</th>\n <td>China</td>\n <td>Northwest Elect Power Design Inst Co Ltd China</td>\n <td>Northwest Elect Power Design Inst Co Ltd</td>\n <td>1</td>\n <td>1</td>\n <td>0.926984</td>\n </tr>\n <tr>\n <th>12</th>\n <td>China</td>\n <td>Northwest Inst Ecoenvironm &amp; Resources</td>\n <td>Northwest Inst Ecoenvironm &amp; Resources Chinese Ac</td>\n <td>1</td>\n <td>1</td>\n <td>0.910630</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 </tr>\n <tr>\n <th>1531</th>\n <td>China</td>\n <td>Chinese Univ Hong Kong Hong</td>\n <td>Chinese Univ Hong Kong</td>\n <td>728</td>\n <td>1</td>\n <td>0.935944</td>\n </tr>\n <tr>\n <th>1532</th>\n <td>China</td>\n <td>Huazhong Univ Sci &amp; Techno</td>\n <td>Huazhong Univ Sci &amp; Technol</td>\n <td>729</td>\n <td>1</td>\n <td>0.989260</td>\n </tr>\n <tr>\n <th>1533</th>\n <td>China</td>\n <td>Hong Kong Polytech Univ Hong Kong</td>\n <td>Hong Kong Polytech Univ</td>\n <td>809</td>\n <td>1</td>\n <td>0.917345</td>\n </tr>\n <tr>\n <th>1534</th>\n <td>China</td>\n <td>Kong Kong Polytech Univ</td>\n <td>Hong Kong Polytech Univ</td>\n <td>809</td>\n <td>1</td>\n <td>0.939416</td>\n </tr>\n <tr>\n <th>1537</th>\n <td>China</td>\n <td>Univ Elect Sci &amp; Technol Chin</td>\n <td>Univ Elect Sci &amp; Technol China</td>\n <td>1076</td>\n <td>1</td>\n <td>0.983258</td>\n </tr>\n </tbody>\n</table>\n<p>346 rows × 6 columns</p>\n</div>"
},
"execution_count": 201,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# fuzzymerger[fuzzymerger[\"Country\"]==\"China\"]"
],
"metadata": {
"collapsed": false
}
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"source": [], "source": [],
@ -396,20 +398,64 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 120, "execution_count": 202,
"outputs": [
{
"data": {
"text/plain": " UT (Unique WOS ID) Institution Country \n244 WOS:000286472300003 Univ Trent Italy \\\n364 WOS:000287586100011 Univ Trent Italy \n410 WOS:000287939200011 Abdus Salam Int Ctr Theoret Phys Italy \n765 WOS:000290996200002 Univ Trent Italy \n907 WOS:000291698400013 INFN Sez Roma 1 Italy \n... ... ... ... \n153063 WOS:000900129900175 Univ Rome Campus Biomed Aquila Italy \n154775 WOS:000929737300001 Prevent & Res Inst Italy \n154813 WOS:000929737300001 Ist Super Sanit Italy \n154855 WOS:000933331200004 Univ Federio II Italy \n154857 WOS:000933331200004 INAF Osservatorio Astron Capodimonte Italy \n\n Institution_harm merge_iter \n244 Univ Trento 1 \n364 Univ Trento 1 \n410 Abdus Salaam Int Ctr Theoret Phys 1 \n765 Univ Trento 1 \n907 Sez Roma 1 \n... ... ... \n153063 Univ Rome Campus Biomed Aquila 2 \n154775 Prevent & Res Inst 2 \n154813 Ist Super Sanita 1 \n154855 Univ Federico 1 \n154857 Osserv Astron Capodimonte 1 \n\n[375 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>UT (Unique WOS ID)</th>\n <th>Institution</th>\n <th>Country</th>\n <th>Institution_harm</th>\n <th>merge_iter</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>244</th>\n <td>WOS:000286472300003</td>\n <td>Univ Trent</td>\n <td>Italy</td>\n <td>Univ Trento</td>\n <td>1</td>\n </tr>\n <tr>\n <th>364</th>\n <td>WOS:000287586100011</td>\n <td>Univ Trent</td>\n <td>Italy</td>\n <td>Univ Trento</td>\n <td>1</td>\n </tr>\n <tr>\n <th>410</th>\n <td>WOS:000287939200011</td>\n <td>Abdus Salam Int Ctr Theoret Phys</td>\n <td>Italy</td>\n <td>Abdus Salaam Int Ctr Theoret Phys</td>\n <td>1</td>\n </tr>\n <tr>\n <th>765</th>\n <td>WOS:000290996200002</td>\n <td>Univ Trent</td>\n <td>Italy</td>\n <td>Univ Trento</td>\n <td>1</td>\n </tr>\n <tr>\n <th>907</th>\n <td>WOS:000291698400013</td>\n <td>INFN Sez Roma 1</td>\n <td>Italy</td>\n <td>Sez Roma</td>\n <td>1</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>153063</th>\n <td>WOS:000900129900175</td>\n <td>Univ Rome Campus Biomed Aquila</td>\n <td>Italy</td>\n <td>Univ Rome Campus Biomed Aquila</td>\n <td>2</td>\n </tr>\n <tr>\n <th>154775</th>\n <td>WOS:000929737300001</td>\n <td>Prevent &amp; Res Inst</td>\n <td>Italy</td>\n <td>Prevent &amp; Res Inst</td>\n <td>2</td>\n </tr>\n <tr>\n <th>154813</th>\n <td>WOS:000929737300001</td>\n <td>Ist Super Sanit</td>\n <td>Italy</td>\n <td>Ist Super Sanita</td>\n <td>1</td>\n </tr>\n <tr>\n <th>154855</th>\n <td>WOS:000933331200004</td>\n <td>Univ Federio II</td>\n <td>Italy</td>\n <td>Univ Federico</td>\n <td>1</td>\n </tr>\n <tr>\n <th>154857</th>\n <td>WOS:000933331200004</td>\n <td>INAF Osservatorio Astron Capodimonte</td>\n <td>Italy</td>\n <td>Osserv Astron Capodimonte</td>\n <td>1</td>\n </tr>\n </tbody>\n</table>\n<p>375 rows × 5 columns</p>\n</div>"
},
"execution_count": 202,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# univ_harm[((univ_harm[\"merge_iter\"]>0) & (univ_harm[\"Country\"]==\"Italy\"))]"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 208,
"outputs": [],
"source": [
"univ_harm.loc[((univ_harm[\"merge_iter\"]>0) & (univ_harm[\"Country\"]==\"Italy\")&\n",
" (univ_harm[\"Institution\"].str.lower().str.contains(\"sapien\"))&\n",
" (univ_harm[\"Institution\"].str.lower().str.contains(\"univ\"))), \"Institution_harm\"] = \"Sapienza Univ Rome\""
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 209,
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": " UT (Unique WOS ID) Institution Country \n244 WOS:000286472300003 Univ Trent Italy \\\n364 WOS:000287586100011 Univ Trent Italy \n410 WOS:000287939200011 Abdus Salam Int Ctr Theoret Phys Italy \n765 WOS:000290996200002 Univ Trent Italy \n907 WOS:000291698400013 INFN Sez Roma 1 Italy \n... ... ... ... \n153063 WOS:000900129900175 Univ Rome Campus Biomed Aquila Italy \n154775 WOS:000929737300001 Prevent & Res Inst Italy \n154813 WOS:000929737300001 Ist Super Sanit Italy \n154855 WOS:000933331200004 Univ Federio II Italy \n154857 WOS:000933331200004 INAF Osservatorio Astron Capodimonte Italy \n\n Institution_harm merge_iter \n244 Univ Trento 1 \n364 Univ Trento 1 \n410 Abdus Salaam Int Ctr Theoret Phys 1 \n765 Univ Trento 1 \n907 Sez Roma 1 \n... ... ... \n153063 Univ Rome Campus Biomed LAquila 1 \n154775 Prevent & Res Inst 2 \n154813 Ist Super Sanita 1 \n154855 Univ Federio 2 \n154857 Osserv Astron Capodimonte 1 \n\n[375 rows x 5 columns]", "text/plain": "Institution 17083\nInstitution_harm 14449\ndtype: int64"
"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>UT (Unique WOS ID)</th>\n <th>Institution</th>\n <th>Country</th>\n <th>Institution_harm</th>\n <th>merge_iter</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>244</th>\n <td>WOS:000286472300003</td>\n <td>Univ Trent</td>\n <td>Italy</td>\n <td>Univ Trento</td>\n <td>1</td>\n </tr>\n <tr>\n <th>364</th>\n <td>WOS:000287586100011</td>\n <td>Univ Trent</td>\n <td>Italy</td>\n <td>Univ Trento</td>\n <td>1</td>\n </tr>\n <tr>\n <th>410</th>\n <td>WOS:000287939200011</td>\n <td>Abdus Salam Int Ctr Theoret Phys</td>\n <td>Italy</td>\n <td>Abdus Salaam Int Ctr Theoret Phys</td>\n <td>1</td>\n </tr>\n <tr>\n <th>765</th>\n <td>WOS:000290996200002</td>\n <td>Univ Trent</td>\n <td>Italy</td>\n <td>Univ Trento</td>\n <td>1</td>\n </tr>\n <tr>\n <th>907</th>\n <td>WOS:000291698400013</td>\n <td>INFN Sez Roma 1</td>\n <td>Italy</td>\n <td>Sez Roma</td>\n <td>1</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>153063</th>\n <td>WOS:000900129900175</td>\n <td>Univ Rome Campus Biomed Aquila</td>\n <td>Italy</td>\n <td>Univ Rome Campus Biomed LAquila</td>\n <td>1</td>\n </tr>\n <tr>\n <th>154775</th>\n <td>WOS:000929737300001</td>\n <td>Prevent &amp; Res Inst</td>\n <td>Italy</td>\n <td>Prevent &amp; Res Inst</td>\n <td>2</td>\n </tr>\n <tr>\n <th>154813</th>\n <td>WOS:000929737300001</td>\n <td>Ist Super Sanit</td>\n <td>Italy</td>\n <td>Ist Super Sanita</td>\n <td>1</td>\n </tr>\n <tr>\n <th>154855</th>\n <td>WOS:000933331200004</td>\n <td>Univ Federio II</td>\n <td>Italy</td>\n <td>Univ Federio</td>\n <td>2</td>\n </tr>\n <tr>\n <th>154857</th>\n <td>WOS:000933331200004</td>\n <td>INAF Osservatorio Astron Capodimonte</td>\n <td>Italy</td>\n <td>Osserv Astron Capodimonte</td>\n <td>1</td>\n </tr>\n </tbody>\n</table>\n<p>375 rows × 5 columns</p>\n</div>"
}, },
"execution_count": 120, "execution_count": 209,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
], ],
"source": [ "source": [
"univ_harm[((univ_harm[\"merge_iter\"]>0) & (univ_harm[\"Country\"]==\"Italy\"))]" "univ_harm[[\"Institution\",\"Institution_harm\"]].nunique()"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 210,
"outputs": [],
"source": [
"univ_harm.to_excel(f\"{outdir}/wos_institution_locations_harmonized.xlsx\", index=False)"
], ],
"metadata": { "metadata": {
"collapsed": false "collapsed": false

Loading…
Cancel
Save