Skip to content

Instantly share code, notes, and snippets.

@giswqs
Created November 11, 2024 20:34
Show Gist options
  • Save giswqs/6296c86c92211419d87ef85c1a71aa7f to your computer and use it in GitHub Desktop.
Save giswqs/6296c86c92211419d87ef85c1a71aa7f to your computer and use it in GitHub Desktop.
Search for GEE publications
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"# %pip install -U scholarpy kaleido"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
"import scholarpy\n",
"import pandas as pd\n",
"import plotly.express as px"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[2mUsing default endpoint: 'https://app.dimensions.ai'\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[2mDimcli - Dimensions API Client (v1.3)\u001b[0m\n",
"\u001b[2mConnected to: <https://app.dimensions.ai/api/dsl> - DSL v2.10\u001b[0m\n",
"\u001b[2mMethod: manual login\u001b[0m\n"
]
}
],
"source": [
"dsl = scholarpy.Dsl()"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
"keywords = \"Google Earth Engine\""
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Starting iteration with limit=1000 skip=0 ...\u001b[0m\n",
"0-1000 / 1975 (7.50s)\u001b[0m\n",
"1000-1975 / 1975 (5.29s)\u001b[0m\n",
"===\n",
"Records extracted: 1975\u001b[0m\n",
"Warnings: 2\u001b[0m\n"
]
}
],
"source": [
"result = dsl.search_pubs_by_keyword(keywords, scope=\"title_only\", iterative=True, limit=1000)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"# result = dsl.search_pubs_by_keyword(keywords, scope=\"title_abstract_only\", iterative=True, limit=1000)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1975"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result.count_total"
]
},
{
"cell_type": "code",
"execution_count": 33,
"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>id</th>\n",
" <th>title</th>\n",
" <th>altmetric</th>\n",
" <th>authors</th>\n",
" <th>authors_count</th>\n",
" <th>dimensions_url</th>\n",
" <th>doi</th>\n",
" <th>field_citation_ratio</th>\n",
" <th>pages</th>\n",
" <th>times_cited</th>\n",
" <th>type</th>\n",
" <th>volume</th>\n",
" <th>year</th>\n",
" <th>journal.id</th>\n",
" <th>journal.title</th>\n",
" <th>issue</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>pub.1090359717</td>\n",
" <td>Google Earth Engine: Planetary-scale geospatia...</td>\n",
" <td>198.0</td>\n",
" <td>[{'affiliations': [{'city': 'Zurich', 'city_id...</td>\n",
" <td>6</td>\n",
" <td>https://app.dimensions.ai/details/publication/...</td>\n",
" <td>10.1016/j.rse.2017.06.031</td>\n",
" <td>3005.39</td>\n",
" <td>18-27</td>\n",
" <td>8756</td>\n",
" <td>article</td>\n",
" <td>202</td>\n",
" <td>2017</td>\n",
" <td>jour.1045931</td>\n",
" <td>Remote Sensing of Environment</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>pub.1127756464</td>\n",
" <td>Google Earth Engine for geo-big data applicati...</td>\n",
" <td>31.0</td>\n",
" <td>[{'affiliations': [{'city': 'Syracuse', 'city_...</td>\n",
" <td>6</td>\n",
" <td>https://app.dimensions.ai/details/publication/...</td>\n",
" <td>10.1016/j.isprsjprs.2020.04.001</td>\n",
" <td>217.75</td>\n",
" <td>152-170</td>\n",
" <td>768</td>\n",
" <td>article</td>\n",
" <td>164</td>\n",
" <td>2020</td>\n",
" <td>jour.1044622</td>\n",
" <td>ISPRS Journal of Photogrammetry and Remote Sen...</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>pub.1049181935</td>\n",
" <td>Mapping paddy rice planting area in northeaste...</td>\n",
" <td>4.0</td>\n",
" <td>[{'affiliations': [{'city': 'Norman', 'city_id...</td>\n",
" <td>8</td>\n",
" <td>https://app.dimensions.ai/details/publication/...</td>\n",
" <td>10.1016/j.rse.2016.02.016</td>\n",
" <td>184.57</td>\n",
" <td>142-154</td>\n",
" <td>604</td>\n",
" <td>article</td>\n",
" <td>185</td>\n",
" <td>2016</td>\n",
" <td>jour.1045931</td>\n",
" <td>Remote Sensing of Environment</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>pub.1130519734</td>\n",
" <td>Google Earth Engine Cloud Computing Platform f...</td>\n",
" <td>57.0</td>\n",
" <td>[{'affiliations': [{'city': 'Ottawa', 'city_id...</td>\n",
" <td>12</td>\n",
" <td>https://app.dimensions.ai/details/publication/...</td>\n",
" <td>10.1109/jstars.2020.3021052</td>\n",
" <td>185.15</td>\n",
" <td>5326-5350</td>\n",
" <td>596</td>\n",
" <td>article</td>\n",
" <td>13</td>\n",
" <td>2020</td>\n",
" <td>jour.1137583</td>\n",
" <td>IEEE Journal of Selected Topics in Applied Ear...</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>pub.1107145592</td>\n",
" <td>Google Earth Engine Applications Since Incepti...</td>\n",
" <td>9.0</td>\n",
" <td>[{'affiliations': [{'city': 'Armidale', 'city_...</td>\n",
" <td>2</td>\n",
" <td>https://app.dimensions.ai/details/publication/...</td>\n",
" <td>10.3390/rs10101509</td>\n",
" <td>175.62</td>\n",
" <td>1509</td>\n",
" <td>524</td>\n",
" <td>article</td>\n",
" <td>10</td>\n",
" <td>2018</td>\n",
" <td>jour.1430766</td>\n",
" <td>Remote Sensing</td>\n",
" <td>10</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id title \\\n",
"0 pub.1090359717 Google Earth Engine: Planetary-scale geospatia... \n",
"1 pub.1127756464 Google Earth Engine for geo-big data applicati... \n",
"2 pub.1049181935 Mapping paddy rice planting area in northeaste... \n",
"3 pub.1130519734 Google Earth Engine Cloud Computing Platform f... \n",
"4 pub.1107145592 Google Earth Engine Applications Since Incepti... \n",
"\n",
" altmetric authors \\\n",
"0 198.0 [{'affiliations': [{'city': 'Zurich', 'city_id... \n",
"1 31.0 [{'affiliations': [{'city': 'Syracuse', 'city_... \n",
"2 4.0 [{'affiliations': [{'city': 'Norman', 'city_id... \n",
"3 57.0 [{'affiliations': [{'city': 'Ottawa', 'city_id... \n",
"4 9.0 [{'affiliations': [{'city': 'Armidale', 'city_... \n",
"\n",
" authors_count dimensions_url \\\n",
"0 6 https://app.dimensions.ai/details/publication/... \n",
"1 6 https://app.dimensions.ai/details/publication/... \n",
"2 8 https://app.dimensions.ai/details/publication/... \n",
"3 12 https://app.dimensions.ai/details/publication/... \n",
"4 2 https://app.dimensions.ai/details/publication/... \n",
"\n",
" doi field_citation_ratio pages \\\n",
"0 10.1016/j.rse.2017.06.031 3005.39 18-27 \n",
"1 10.1016/j.isprsjprs.2020.04.001 217.75 152-170 \n",
"2 10.1016/j.rse.2016.02.016 184.57 142-154 \n",
"3 10.1109/jstars.2020.3021052 185.15 5326-5350 \n",
"4 10.3390/rs10101509 175.62 1509 \n",
"\n",
" times_cited type volume year journal.id \\\n",
"0 8756 article 202 2017 jour.1045931 \n",
"1 768 article 164 2020 jour.1044622 \n",
"2 604 article 185 2016 jour.1045931 \n",
"3 596 article 13 2020 jour.1137583 \n",
"4 524 article 10 2018 jour.1430766 \n",
"\n",
" journal.title issue \n",
"0 Remote Sensing of Environment NaN \n",
"1 ISPRS Journal of Photogrammetry and Remote Sen... NaN \n",
"2 Remote Sensing of Environment NaN \n",
"3 IEEE Journal of Selected Topics in Applied Ear... NaN \n",
"4 Remote Sensing 10 "
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = result.as_dataframe()\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
"df.to_csv(\"Earth_Engine_title_only.csv\", sep=\"\\t\")"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
"start_year = 2012\n",
"end_year = 2025"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
"query = f'search publications in title_only for \"{keywords}\" where year>={start_year} and year<{end_year} return year limit 100'"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Returned Year: 13\n",
"\u001b[2mTime: 5.54s\u001b[0m\n"
]
}
],
"source": [
"result = dsl.query(query)"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [],
"source": [
"df = result.as_dataframe()"
]
},
{
"cell_type": "code",
"execution_count": 39,
"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>id</th>\n",
" <th>count</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2023</td>\n",
" <td>462</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2022</td>\n",
" <td>401</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2024</td>\n",
" <td>383</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2021</td>\n",
" <td>321</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2020</td>\n",
" <td>223</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>2019</td>\n",
" <td>96</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>2018</td>\n",
" <td>52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>2017</td>\n",
" <td>21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>2016</td>\n",
" <td>7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>2015</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>2012</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>2013</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>2014</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id count\n",
"0 2023 462\n",
"1 2022 401\n",
"2 2024 383\n",
"3 2021 321\n",
"4 2020 223\n",
"5 2019 96\n",
"6 2018 52\n",
"7 2017 21\n",
"8 2016 7\n",
"9 2015 5\n",
"10 2012 1\n",
"11 2013 1\n",
"12 2014 1"
]
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": 40,
"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>Year</th>\n",
" <th>Title_only</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2023</td>\n",
" <td>462</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2022</td>\n",
" <td>401</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2024</td>\n",
" <td>383</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2021</td>\n",
" <td>321</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2020</td>\n",
" <td>223</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>2019</td>\n",
" <td>96</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>2018</td>\n",
" <td>52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>2017</td>\n",
" <td>21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>2016</td>\n",
" <td>7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>2015</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>2012</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>2013</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>2014</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Year Title_only\n",
"0 2023 462\n",
"1 2022 401\n",
"2 2024 383\n",
"3 2021 321\n",
"4 2020 223\n",
"5 2019 96\n",
"6 2018 52\n",
"7 2017 21\n",
"8 2016 7\n",
"9 2015 5\n",
"10 2012 1\n",
"11 2013 1\n",
"12 2014 1"
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.columns = [\"Year\", \"Title_only\"]\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [],
"source": [
"query2 = f'search publications in title_abstract_only for \"{keywords}\" where year>={start_year} and year<{end_year} return year limit 100'"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Returned Year: 13\n",
"\u001b[2mTime: 0.27s\u001b[0m\n"
]
}
],
"source": [
"result2 = dsl.query(query2)"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [],
"source": [
"df2 = result2.as_dataframe()"
]
},
{
"cell_type": "code",
"execution_count": 44,
"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>Year</th>\n",
" <th>Title_abstract</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2023</td>\n",
" <td>1495</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2024</td>\n",
" <td>1476</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2022</td>\n",
" <td>1252</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2021</td>\n",
" <td>881</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2020</td>\n",
" <td>531</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>2019</td>\n",
" <td>245</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>2018</td>\n",
" <td>130</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>2017</td>\n",
" <td>57</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>2016</td>\n",
" <td>20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>2015</td>\n",
" <td>13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>2012</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>2013</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>2014</td>\n",
" <td>4</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Year Title_abstract\n",
"0 2023 1495\n",
"1 2024 1476\n",
"2 2022 1252\n",
"3 2021 881\n",
"4 2020 531\n",
"5 2019 245\n",
"6 2018 130\n",
"7 2017 57\n",
"8 2016 20\n",
"9 2015 13\n",
"10 2012 6\n",
"11 2013 5\n",
"12 2014 4"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2.columns = [\"Year\", \"Title_abstract\"]\n",
"df2"
]
},
{
"cell_type": "code",
"execution_count": 45,
"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>Year</th>\n",
" <th>Title_only</th>\n",
" <th>Title_abstract</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>2023</td>\n",
" <td>462</td>\n",
" <td>1495</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2022</td>\n",
" <td>401</td>\n",
" <td>1252</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>2024</td>\n",
" <td>383</td>\n",
" <td>1476</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2021</td>\n",
" <td>321</td>\n",
" <td>881</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>2020</td>\n",
" <td>223</td>\n",
" <td>531</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>2019</td>\n",
" <td>96</td>\n",
" <td>245</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>2018</td>\n",
" <td>52</td>\n",
" <td>130</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>2017</td>\n",
" <td>21</td>\n",
" <td>57</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>2016</td>\n",
" <td>7</td>\n",
" <td>20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>2015</td>\n",
" <td>5</td>\n",
" <td>13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>2012</td>\n",
" <td>1</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>2013</td>\n",
" <td>1</td>\n",
" <td>5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>2014</td>\n",
" <td>1</td>\n",
" <td>4</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Year Title_only Title_abstract\n",
"0 2023 462 1495\n",
"1 2022 401 1252\n",
"2 2024 383 1476\n",
"3 2021 321 881\n",
"4 2020 223 531\n",
"5 2019 96 245\n",
"6 2018 52 130\n",
"7 2017 21 57\n",
"8 2016 7 20\n",
"9 2015 5 13\n",
"10 2012 1 6\n",
"11 2013 1 5\n",
"12 2014 1 4"
]
},
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_merge = df.merge(df2, on='Year')\n",
"df_merge"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Year 26234\n",
"Title_only 1974\n",
"Title_abstract 6115\n",
"dtype: int64"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_merge.sum()"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [],
"source": [
"fig = px.bar(\n",
" df_merge, \n",
" x = \"Year\",\n",
" y = ['Title_only', 'Title_abstract'],\n",
" barmode=\"group\",\n",
" \n",
")"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"alignmentgroup": "True",
"hovertemplate": "variable=Title_only<br>Year=%{x}<br>value=%{y}<extra></extra>",
"legendgroup": "Title_only",
"marker": {
"color": "#636efa",
"pattern": {
"shape": ""
}
},
"name": "Title_only",
"offsetgroup": "Title_only",
"orientation": "v",
"showlegend": true,
"textposition": "auto",
"type": "bar",
"x": [
2023,
2022,
2024,
2021,
2020,
2019,
2018,
2017,
2016,
2015,
2012,
2013,
2014
],
"xaxis": "x",
"y": [
462,
401,
383,
321,
223,
96,
52,
21,
7,
5,
1,
1,
1
],
"yaxis": "y"
},
{
"alignmentgroup": "True",
"hovertemplate": "variable=Title_abstract<br>Year=%{x}<br>value=%{y}<extra></extra>",
"legendgroup": "Title_abstract",
"marker": {
"color": "#EF553B",
"pattern": {
"shape": ""
}
},
"name": "Title_abstract",
"offsetgroup": "Title_abstract",
"orientation": "v",
"showlegend": true,
"textposition": "auto",
"type": "bar",
"x": [
2023,
2022,
2024,
2021,
2020,
2019,
2018,
2017,
2016,
2015,
2012,
2013,
2014
],
"xaxis": "x",
"y": [
1495,
1252,
1476,
881,
531,
245,
130,
57,
20,
13,
6,
5,
4
],
"yaxis": "y"
}
],
"layout": {
"barmode": "group",
"legend": {
"title": {
"text": "Search scope"
},
"tracegroupgap": 0
},
"margin": {
"t": 60
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"contour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "contour"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"heatmap": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmap"
}
],
"heatmapgl": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmapgl"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"histogram2d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2d"
}
],
"histogram2dcontour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2dcontour"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"scatter3d": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatter3d"
}
],
"scattercarpet": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattercarpet"
}
],
"scattergeo": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergeo"
}
],
"scattergl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergl"
}
],
"scattermapbox": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattermapbox"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"scatterternary": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterternary"
}
],
"surface": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "surface"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#EBF0F8"
},
"line": {
"color": "white"
}
},
"header": {
"fill": {
"color": "#C8D4E3"
},
"line": {
"color": "white"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#2a3f5f",
"arrowhead": 0,
"arrowwidth": 1
},
"autotypenumbers": "strict",
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"diverging": [
[
0,
"#8e0152"
],
[
0.1,
"#c51b7d"
],
[
0.2,
"#de77ae"
],
[
0.3,
"#f1b6da"
],
[
0.4,
"#fde0ef"
],
[
0.5,
"#f7f7f7"
],
[
0.6,
"#e6f5d0"
],
[
0.7,
"#b8e186"
],
[
0.8,
"#7fbc41"
],
[
0.9,
"#4d9221"
],
[
1,
"#276419"
]
],
"sequential": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"sequentialminus": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
]
},
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#2a3f5f"
},
"geo": {
"bgcolor": "white",
"lakecolor": "white",
"landcolor": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "The number of journal publications empowered by Google Earth Engine",
"x": 0.5
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
],
"title": {
"text": "Year"
}
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "Publication count"
}
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig.update_yaxes(title_text=\"Publication count\")\n",
"fig.update_layout(title=f\"The number of journal publications empowered by {keywords}\",title_x=0.5, legend_title=\"Search scope\")"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [],
"source": [
"fig.write_image(\"GEE_pubs.jpg\", width=1000, height=600, scale=2)"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [],
"source": [
"fig.write_image(\"GEE_pubs.pdf\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "geo",
"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.12.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment