diff --git a/models/growth-engine/core/domain/Google_Sheets_Update_organizations_db.ipynb b/models/growth-engine/core/domain/Google_Sheets_Update_organizations_db.ipynb index 64420361..e6c8dc43 100644 --- a/models/growth-engine/core/domain/Google_Sheets_Update_organizations_db.ipynb +++ b/models/growth-engine/core/domain/Google_Sheets_Update_organizations_db.ipynb @@ -97,8 +97,7 @@ "import openai\n", "import time\n", "from googlesearch import search\n", - "import re\n", - "import pycountry" + "import re" ] }, { @@ -450,16 +449,6 @@ }, "outputs": [], "source": [ - "def get_country_name(country_code):\n", - " country_name = \"Not Found\"\n", - " if str(country_code) != \"None\":\n", - " try:\n", - " country = pycountry.countries.get(alpha_2=country_code)\n", - " country_name = country.name\n", - " except Exception as e:\n", - " print(e)\n", - " return country_name\n", - "\n", "def enrich_organizations(\n", " df_init,\n", " output_dir,\n", diff --git a/utils/data.ipynb b/utils/data.ipynb index 846dbe72..2aaab51a 100644 --- a/utils/data.ipynb +++ b/utils/data.ipynb @@ -59,7 +59,8 @@ "from naas_drivers import linkedin\n", "import naas_data_product\n", "import shutil\n", - "import pandas as pd" + "import pandas as pd\n", + "import pycountry" ] }, { @@ -70,6 +71,32 @@ "## Model" ] }, + { + "cell_type": "markdown", + "id": "5d0cb0b8-ba48-4ceb-91c0-c4001d7e78f8", + "metadata": {}, + "source": [ + "### Get country name" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a6cb615f-d36f-455e-9c3e-decef98f1ea3", + "metadata": {}, + "outputs": [], + "source": [ + "def get_country_name(country_code):\n", + " country_name = \"Not Found\"\n", + " if str(country_code) not in [\"None\", \"OO\"] :\n", + " try:\n", + " country = pycountry.countries.get(alpha_2=country_code)\n", + " country_name = country.name\n", + " except Exception as e:\n", + " print(e)\n", + " return country_name" + ] + }, { "cell_type": "markdown", "id": "a30d711f-aacb-44cf-ae31-636f96976a75",