refactoring

This commit is contained in:
frankknoll
2022-02-19 15:14:23 +01:00
parent b2d4e93df6
commit 608f268a84
14 changed files with 25 additions and 22 deletions

View File

@@ -1352,15 +1352,17 @@
"metadata": {},
"outputs": [],
"source": [
"def createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country):\n",
"def createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country, minADRsForLethality = None):\n",
" batchCodeTable = InternationalLotTableFactory.createBatchCodeTableByCountry(nonDomesticVaers, country)\n",
" batchCodeTable = batchCodeTable[batchCodeTable['Total Number of Adverse Reaction Reports'] > 50]\n",
" batchCodeTable.index.set_names(\"Batch\", inplace = True)\n",
" if minADRsForLethality is not None:\n",
" batchCodeTable.loc[batchCodeTable['Total Number of Adverse Reaction Reports'] < minADRsForLethality, 'Severe reports (%)'] = np.nan\n",
" IOUtils.saveDataFrame(batchCodeTable, '../data/' + country)\n",
" display(country + \":\", batchCodeTable)\n",
"\n",
"def createAndSaveAndDisplayBatchCodeTablesByCountry(nonDomesticVaers, countries):\n",
"def createAndSaveAndDisplayBatchCodeTablesByCountry(nonDomesticVaers, countries, minADRsForLethality = None):\n",
" for country in countries:\n",
" createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country)"
" createAndSaveAndDisplayBatchCodeTableByCountry(nonDomesticVaers, country, minADRsForLethality)"
]
},
{
@@ -1385,7 +1387,8 @@
" 'Sweden',\n",
" 'Portugal',\n",
" 'Australia'\n",
" ])"
" ],\n",
" minADRsForLethality = 100)"
]
},
{