adding more countries
This commit is contained in:
@@ -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)"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user