adding more countries

This commit is contained in:
frankknoll
2022-02-19 22:41:58 +01:00
parent 6594ef67e6
commit fef6719762
153 changed files with 355 additions and 28 deletions

View File

@@ -333,13 +333,17 @@
" \n",
" @staticmethod\n",
" def addCountryColumn(dataFrame, countryColumnName):\n",
" dataFrame[countryColumnName] = dataFrame.apply(\n",
" dataFrame[countryColumnName] = CountryColumnAdder.getCountryColumn(dataFrame)\n",
" return dataFrame.astype({countryColumnName: \"string\"})\n",
"\n",
" @staticmethod\n",
" def getCountryColumn(dataFrame):\n",
" return dataFrame.apply(\n",
" lambda row:\n",
" CountryColumnAdder._getCountryNameOfSplttypeOrDefault(\n",
" splttype = row['SPLTTYPE'],\n",
" default = 'Unknown Country'),\n",
" axis = 'columns')\n",
" return dataFrame.astype({countryColumnName: \"string\"})\n",
"\n",
" @staticmethod\n",
" def _getCountryNameOfSplttypeOrDefault(splttype, default):\n",
@@ -1397,6 +1401,41 @@
" createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country, minADRsForLethality)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cc1ef82a",
"metadata": {},
"outputs": [],
"source": [
"def printCountryOptions(countries):\n",
" for country in countries:\n",
" printCountryOption(country)\n",
"\n",
"def printCountryOption(country):\n",
" print('<option value=\"{country}\">{country}</option>'.format(country = country))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0c4d04fb",
"metadata": {},
"outputs": [],
"source": [
"countries = sorted(CountryColumnAdder.getCountryColumn(nonDomesticVaers).unique())"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e3d09ffa",
"metadata": {},
"outputs": [],
"source": [
"printCountryOptions(countries)"
]
},
{
"cell_type": "code",
"execution_count": null,
@@ -1406,21 +1445,7 @@
"source": [
"createAndSaveAndDisplayBatchCodeTablesByCountry(\n",
" nonDomesticVaers,\n",
" # FK-TODO: create BatchCodeTables for all available countries\n",
" [\n",
" 'United Kingdom',\n",
" 'France',\n",
" 'Germany',\n",
" 'Japan',\n",
" 'Italy',\n",
" 'Austria',\n",
" 'Netherlands',\n",
" 'Spain',\n",
" 'Belgium',\n",
" 'Sweden',\n",
" 'Portugal',\n",
" 'Australia'\n",
" ],\n",
" countries,\n",
" minADRsForLethality = 100)"
]
},