refactoring
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"cells": [
|
"cells": [
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 21,
|
"execution_count": null,
|
||||||
"id": "9de5907f-18f5-4cb1-903e-26028ff1fa03",
|
"id": "9de5907f-18f5-4cb1-903e-26028ff1fa03",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 22,
|
"execution_count": null,
|
||||||
"id": "a271254b",
|
"id": "a271254b",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 23,
|
"execution_count": null,
|
||||||
"id": "7b5d6df0",
|
"id": "7b5d6df0",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 24,
|
"execution_count": null,
|
||||||
"id": "3ebcba86",
|
"id": "3ebcba86",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 25,
|
"execution_count": null,
|
||||||
"id": "99945ca8",
|
"id": "99945ca8",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -129,14 +129,11 @@
|
|||||||
" \n",
|
" \n",
|
||||||
" @staticmethod\n",
|
" @staticmethod\n",
|
||||||
" def createBatchCodeTable(df : pd.DataFrame):\n",
|
" def createBatchCodeTable(df : pd.DataFrame):\n",
|
||||||
" def filterDataFrame(df, col):\n",
|
|
||||||
" return df[df[col] == 'Y']['VAX_LOT']\n",
|
|
||||||
"\n",
|
|
||||||
" batchCodeTableDict = {\n",
|
" batchCodeTableDict = {\n",
|
||||||
" 'ADRs': df['VAX_LOT'].value_counts(),\n",
|
" 'ADRs': df['VAX_LOT'].value_counts(),\n",
|
||||||
" 'DEATHS': filterDataFrame(df, 'DIED').value_counts(),\n",
|
" 'DEATHS': BatchCodeTableFactory._filterDataFrame(df, 'DIED').value_counts(),\n",
|
||||||
" 'DISABILITIES': filterDataFrame(df, 'DISABLE').value_counts(),\n",
|
" 'DISABILITIES': BatchCodeTableFactory._filterDataFrame(df, 'DISABLE').value_counts(),\n",
|
||||||
" 'LIFE THREATENING ILLNESSES': filterDataFrame(df, 'L_THREAT').value_counts()\n",
|
" 'LIFE THREATENING ILLNESSES': BatchCodeTableFactory._filterDataFrame(df, 'L_THREAT').value_counts()\n",
|
||||||
" }\n",
|
" }\n",
|
||||||
" batchCodeTable = pd.concat(batchCodeTableDict, axis = 'columns')\n",
|
" batchCodeTable = pd.concat(batchCodeTableDict, axis = 'columns')\n",
|
||||||
" batchCodeTable.index.name = 'VAX_LOT'\n",
|
" batchCodeTable.index.name = 'VAX_LOT'\n",
|
||||||
@@ -146,16 +143,13 @@
|
|||||||
" # FK-TODO: DRY with createBatchCodeTable()\n",
|
" # FK-TODO: DRY with createBatchCodeTable()\n",
|
||||||
" @staticmethod\n",
|
" @staticmethod\n",
|
||||||
" def createSevereEffectsBatchCodeTable(df : pd.DataFrame):\n",
|
" def createSevereEffectsBatchCodeTable(df : pd.DataFrame):\n",
|
||||||
" def filterDataFrame(df, col):\n",
|
|
||||||
" return df[df[col] == 'Y']['VAX_LOT']\n",
|
|
||||||
"\n",
|
|
||||||
" batchCodeTableDict = {\n",
|
" batchCodeTableDict = {\n",
|
||||||
" 'ADRs': df['VAX_LOT'].value_counts(),\n",
|
" 'ADRs': df['VAX_LOT'].value_counts(),\n",
|
||||||
" 'DEATHS': filterDataFrame(df, 'DIED').value_counts(),\n",
|
" 'DEATHS': BatchCodeTableFactory._filterDataFrame(df, 'DIED').value_counts(),\n",
|
||||||
" 'DISABILITIES': filterDataFrame(df, 'DISABLE').value_counts(),\n",
|
" 'DISABILITIES': BatchCodeTableFactory._filterDataFrame(df, 'DISABLE').value_counts(),\n",
|
||||||
" 'LIFE THREATENING ILLNESSES': filterDataFrame(df, 'L_THREAT').value_counts(),\n",
|
" 'LIFE THREATENING ILLNESSES': BatchCodeTableFactory._filterDataFrame(df, 'L_THREAT').value_counts(),\n",
|
||||||
" 'HOSPITALISATIONS': filterDataFrame(df, 'HOSPITAL').value_counts(),\n",
|
" 'HOSPITALISATIONS': BatchCodeTableFactory._filterDataFrame(df, 'HOSPITAL').value_counts(),\n",
|
||||||
" 'EMERGENCY ROOM OR DOCTOR VISITS': filterDataFrame(df, 'ER_VISIT').value_counts()\n",
|
" 'EMERGENCY ROOM OR DOCTOR VISITS': BatchCodeTableFactory._filterDataFrame(df, 'ER_VISIT').value_counts()\n",
|
||||||
" }\n",
|
" }\n",
|
||||||
" batchCodeTable = pd.concat(batchCodeTableDict, axis = 'columns')\n",
|
" batchCodeTable = pd.concat(batchCodeTableDict, axis = 'columns')\n",
|
||||||
" batchCodeTable.index.name = 'VAX_LOT'\n",
|
" batchCodeTable.index.name = 'VAX_LOT'\n",
|
||||||
@@ -170,6 +164,10 @@
|
|||||||
" return batchCodeTable.replace(to_replace = np.nan, value = 0)\n",
|
" return batchCodeTable.replace(to_replace = np.nan, value = 0)\n",
|
||||||
"\n",
|
"\n",
|
||||||
" @staticmethod\n",
|
" @staticmethod\n",
|
||||||
|
" def _filterDataFrame(df, col):\n",
|
||||||
|
" return df[df[col] == 'Y']['VAX_LOT']\n",
|
||||||
|
"\n",
|
||||||
|
" @staticmethod\n",
|
||||||
" def _createManufacturerByBatchCodeTable(df):\n",
|
" def _createManufacturerByBatchCodeTable(df):\n",
|
||||||
" manufacturerByBatchCodeTable = df[['VAX_LOT', 'VAX_MANU']]\n",
|
" manufacturerByBatchCodeTable = df[['VAX_LOT', 'VAX_MANU']]\n",
|
||||||
" manufacturerByBatchCodeTable = manufacturerByBatchCodeTable.drop_duplicates(subset = ['VAX_LOT'])\n",
|
" manufacturerByBatchCodeTable = manufacturerByBatchCodeTable.drop_duplicates(subset = ['VAX_LOT'])\n",
|
||||||
@@ -182,7 +180,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 26,
|
"execution_count": null,
|
||||||
"id": "3dacedfd",
|
"id": "3dacedfd",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -192,7 +190,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 27,
|
"execution_count": null,
|
||||||
"id": "e59a1825",
|
"id": "e59a1825",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -366,7 +364,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 28,
|
"execution_count": null,
|
||||||
"id": "e14465d7",
|
"id": "e14465d7",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -445,7 +443,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 29,
|
"execution_count": null,
|
||||||
"id": "ded70c87",
|
"id": "ded70c87",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -502,46 +500,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 30,
|
"execution_count": null,
|
||||||
"id": "5a8bff1b",
|
"id": "5a8bff1b",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stderr",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"test_createBatchCodeTable (__main__.BatchCodeTableTest) ... ok\n",
|
|
||||||
"test_createBatchCodeTable2 (__main__.BatchCodeTableTest) ... ok\n",
|
|
||||||
"test_createAndFilterDataFrameFromDescrs (__main__.CreateAndFilterDataFrameTest) ... ok\n",
|
|
||||||
"test_createAndFilterDataFrameFromDescrsWithFirstDose (__main__.CreateAndFilterDataFrameTest) ... ok\n",
|
|
||||||
"test_createAndFilterDataFrameFromDescrsWithSecondDose (__main__.CreateAndFilterDataFrameTest) ... ok\n",
|
|
||||||
"test_createDataFrameFromForSevereEffects (__main__.CreateAndFilterDataFrameTest) ... ok\n",
|
|
||||||
"test_createSevereEffectsBatchCodeTable (__main__.SevereEffectsBatchCodeTableTest) ... ok\n",
|
|
||||||
"\n",
|
|
||||||
"----------------------------------------------------------------------\n",
|
|
||||||
"Ran 7 tests in 0.143s\n",
|
|
||||||
"\n",
|
|
||||||
"OK\n"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"data": {
|
|
||||||
"text/plain": [
|
|
||||||
"<unittest.main.TestProgram at 0x7f63c8007580>"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"execution_count": 30,
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "execute_result"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"unittest.main(argv = [''], verbosity = 2, exit = False)"
|
"unittest.main(argv = [''], verbosity = 2, exit = False)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 32,
|
"execution_count": null,
|
||||||
"id": "86e0e4f2",
|
"id": "86e0e4f2",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -557,452 +526,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 33,
|
"execution_count": null,
|
||||||
"id": "ab170c16",
|
"id": "ab170c16",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"data": {
|
|
||||||
"text/plain": [
|
|
||||||
"'MODERNA'"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "display_data"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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>ADRs</th>\n",
|
|
||||||
" <th>DEATHS</th>\n",
|
|
||||||
" <th>DISABILITIES</th>\n",
|
|
||||||
" <th>LIFE THREATENING ILLNESSES</th>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>VAX_LOT</th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" </thead>\n",
|
|
||||||
" <tbody>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>039K20A</th>\n",
|
|
||||||
" <td>3330</td>\n",
|
|
||||||
" <td>67.0</td>\n",
|
|
||||||
" <td>22.0</td>\n",
|
|
||||||
" <td>29.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>026L20A</th>\n",
|
|
||||||
" <td>3327</td>\n",
|
|
||||||
" <td>25.0</td>\n",
|
|
||||||
" <td>24.0</td>\n",
|
|
||||||
" <td>21.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>011J20A</th>\n",
|
|
||||||
" <td>3072</td>\n",
|
|
||||||
" <td>33.0</td>\n",
|
|
||||||
" <td>27.0</td>\n",
|
|
||||||
" <td>26.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>025L20A</th>\n",
|
|
||||||
" <td>2391</td>\n",
|
|
||||||
" <td>42.0</td>\n",
|
|
||||||
" <td>16.0</td>\n",
|
|
||||||
" <td>26.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>012L20A</th>\n",
|
|
||||||
" <td>2352</td>\n",
|
|
||||||
" <td>57.0</td>\n",
|
|
||||||
" <td>28.0</td>\n",
|
|
||||||
" <td>22.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>...</th>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>0481az11a</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>fc002B21A</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>0021321N</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>elg263</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>0840Z1A</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>1.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" </tbody>\n",
|
|
||||||
"</table>\n",
|
|
||||||
"<p>10248 rows × 4 columns</p>\n",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"text/plain": [
|
|
||||||
" ADRs DEATHS DISABILITIES LIFE THREATENING ILLNESSES\n",
|
|
||||||
"VAX_LOT \n",
|
|
||||||
"039K20A 3330 67.0 22.0 29.0\n",
|
|
||||||
"026L20A 3327 25.0 24.0 21.0\n",
|
|
||||||
"011J20A 3072 33.0 27.0 26.0\n",
|
|
||||||
"025L20A 2391 42.0 16.0 26.0\n",
|
|
||||||
"012L20A 2352 57.0 28.0 22.0\n",
|
|
||||||
"... ... ... ... ...\n",
|
|
||||||
"0481az11a 1 0.0 0.0 0.0\n",
|
|
||||||
"fc002B21A 1 0.0 0.0 0.0\n",
|
|
||||||
"0021321N 1 0.0 0.0 0.0\n",
|
|
||||||
"elg263 1 0.0 0.0 0.0\n",
|
|
||||||
"0840Z1A 1 0.0 0.0 1.0\n",
|
|
||||||
"\n",
|
|
||||||
"[10248 rows x 4 columns]"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "display_data"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"data": {
|
|
||||||
"text/plain": [
|
|
||||||
"'PFIZER\\\\BIONTECH'"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "display_data"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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>ADRs</th>\n",
|
|
||||||
" <th>DEATHS</th>\n",
|
|
||||||
" <th>DISABILITIES</th>\n",
|
|
||||||
" <th>LIFE THREATENING ILLNESSES</th>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>VAX_LOT</th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" </thead>\n",
|
|
||||||
" <tbody>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>EK5730</th>\n",
|
|
||||||
" <td>1741</td>\n",
|
|
||||||
" <td>18.0</td>\n",
|
|
||||||
" <td>25.0</td>\n",
|
|
||||||
" <td>16.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>EK9231</th>\n",
|
|
||||||
" <td>1631</td>\n",
|
|
||||||
" <td>37.0</td>\n",
|
|
||||||
" <td>19.0</td>\n",
|
|
||||||
" <td>21.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>EH9899</th>\n",
|
|
||||||
" <td>1570</td>\n",
|
|
||||||
" <td>14.0</td>\n",
|
|
||||||
" <td>36.0</td>\n",
|
|
||||||
" <td>18.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>EN6205</th>\n",
|
|
||||||
" <td>1487</td>\n",
|
|
||||||
" <td>25.0</td>\n",
|
|
||||||
" <td>37.0</td>\n",
|
|
||||||
" <td>31.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>EN6208</th>\n",
|
|
||||||
" <td>1475</td>\n",
|
|
||||||
" <td>33.0</td>\n",
|
|
||||||
" <td>27.0</td>\n",
|
|
||||||
" <td>25.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>...</th>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>EWD0153</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>EW0160</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>1.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>EP 6203</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>En 6208. A</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>FJ1161</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" </tbody>\n",
|
|
||||||
"</table>\n",
|
|
||||||
"<p>6765 rows × 4 columns</p>\n",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"text/plain": [
|
|
||||||
" ADRs DEATHS DISABILITIES LIFE THREATENING ILLNESSES\n",
|
|
||||||
"VAX_LOT \n",
|
|
||||||
"EK5730 1741 18.0 25.0 16.0\n",
|
|
||||||
"EK9231 1631 37.0 19.0 21.0\n",
|
|
||||||
"EH9899 1570 14.0 36.0 18.0\n",
|
|
||||||
"EN6205 1487 25.0 37.0 31.0\n",
|
|
||||||
"EN6208 1475 33.0 27.0 25.0\n",
|
|
||||||
"... ... ... ... ...\n",
|
|
||||||
"EWD0153 1 0.0 0.0 0.0\n",
|
|
||||||
"EW0160 1 0.0 0.0 1.0\n",
|
|
||||||
"EP 6203 1 0.0 0.0 0.0\n",
|
|
||||||
"En 6208. A 1 0.0 0.0 0.0\n",
|
|
||||||
"FJ1161 1 0.0 0.0 0.0\n",
|
|
||||||
"\n",
|
|
||||||
"[6765 rows x 4 columns]"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "display_data"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"data": {
|
|
||||||
"text/plain": [
|
|
||||||
"'JANSSEN'"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "display_data"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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>ADRs</th>\n",
|
|
||||||
" <th>DEATHS</th>\n",
|
|
||||||
" <th>DISABILITIES</th>\n",
|
|
||||||
" <th>LIFE THREATENING ILLNESSES</th>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>VAX_LOT</th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" </thead>\n",
|
|
||||||
" <tbody>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>043A21A</th>\n",
|
|
||||||
" <td>1692</td>\n",
|
|
||||||
" <td>28.0</td>\n",
|
|
||||||
" <td>29.0</td>\n",
|
|
||||||
" <td>37.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>042A21A</th>\n",
|
|
||||||
" <td>1461</td>\n",
|
|
||||||
" <td>43.0</td>\n",
|
|
||||||
" <td>33.0</td>\n",
|
|
||||||
" <td>35.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>202A21A</th>\n",
|
|
||||||
" <td>1159</td>\n",
|
|
||||||
" <td>22.0</td>\n",
|
|
||||||
" <td>16.0</td>\n",
|
|
||||||
" <td>21.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>201A21A</th>\n",
|
|
||||||
" <td>1129</td>\n",
|
|
||||||
" <td>15.0</td>\n",
|
|
||||||
" <td>27.0</td>\n",
|
|
||||||
" <td>24.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>1805018</th>\n",
|
|
||||||
" <td>1129</td>\n",
|
|
||||||
" <td>32.0</td>\n",
|
|
||||||
" <td>30.0</td>\n",
|
|
||||||
" <td>39.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>...</th>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>MVP-COVID-19 18</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>1.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>2039219</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>1807982</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>043az1n</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>213s21a</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" </tbody>\n",
|
|
||||||
"</table>\n",
|
|
||||||
"<p>1797 rows × 4 columns</p>\n",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"text/plain": [
|
|
||||||
" ADRs DEATHS DISABILITIES LIFE THREATENING ILLNESSES\n",
|
|
||||||
"VAX_LOT \n",
|
|
||||||
"043A21A 1692 28.0 29.0 37.0\n",
|
|
||||||
"042A21A 1461 43.0 33.0 35.0\n",
|
|
||||||
"202A21A 1159 22.0 16.0 21.0\n",
|
|
||||||
"201A21A 1129 15.0 27.0 24.0\n",
|
|
||||||
"1805018 1129 32.0 30.0 39.0\n",
|
|
||||||
"... ... ... ... ...\n",
|
|
||||||
"MVP-COVID-19 18 1 0.0 0.0 1.0\n",
|
|
||||||
"2039219 1 0.0 0.0 0.0\n",
|
|
||||||
"1807982 1 0.0 0.0 0.0\n",
|
|
||||||
"043az1n 1 0.0 0.0 0.0\n",
|
|
||||||
"213s21a 1 0.0 0.0 0.0\n",
|
|
||||||
"\n",
|
|
||||||
"[1797 rows x 4 columns]"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "display_data"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"saveBatchCodeTable(\"MODERNA\", \"results/moderna.xlsx\")\n",
|
"saveBatchCodeTable(\"MODERNA\", \"results/moderna.xlsx\")\n",
|
||||||
"saveBatchCodeTable(\"PFIZER\\BIONTECH\", \"results/pfizer.xlsx\")\n",
|
"saveBatchCodeTable(\"PFIZER\\BIONTECH\", \"results/pfizer.xlsx\")\n",
|
||||||
@@ -1011,7 +538,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 34,
|
"execution_count": null,
|
||||||
"id": "bc56831d",
|
"id": "bc56831d",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -1027,225 +554,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 35,
|
"execution_count": null,
|
||||||
"id": "ace3fed9",
|
"id": "ace3fed9",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"data": {
|
|
||||||
"text/plain": [
|
|
||||||
"'severeEffectsBatchCodeTable'"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "display_data"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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>ADRs</th>\n",
|
|
||||||
" <th>DEATHS</th>\n",
|
|
||||||
" <th>DISABILITIES</th>\n",
|
|
||||||
" <th>LIFE THREATENING ILLNESSES</th>\n",
|
|
||||||
" <th>HOSPITALISATIONS</th>\n",
|
|
||||||
" <th>EMERGENCY ROOM OR DOCTOR VISITS</th>\n",
|
|
||||||
" <th>COMPANY</th>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>VAX_LOT</th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" <th></th>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" </thead>\n",
|
|
||||||
" <tbody>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>026L20A</th>\n",
|
|
||||||
" <td>3335</td>\n",
|
|
||||||
" <td>25.0</td>\n",
|
|
||||||
" <td>24.0</td>\n",
|
|
||||||
" <td>21.0</td>\n",
|
|
||||||
" <td>125.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>MODERNA</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>039K20A</th>\n",
|
|
||||||
" <td>3335</td>\n",
|
|
||||||
" <td>67.0</td>\n",
|
|
||||||
" <td>22.0</td>\n",
|
|
||||||
" <td>29.0</td>\n",
|
|
||||||
" <td>134.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>MODERNA</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>011J20A</th>\n",
|
|
||||||
" <td>3078</td>\n",
|
|
||||||
" <td>34.0</td>\n",
|
|
||||||
" <td>27.0</td>\n",
|
|
||||||
" <td>26.0</td>\n",
|
|
||||||
" <td>106.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>MODERNA</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>025L20A</th>\n",
|
|
||||||
" <td>2397</td>\n",
|
|
||||||
" <td>42.0</td>\n",
|
|
||||||
" <td>16.0</td>\n",
|
|
||||||
" <td>26.0</td>\n",
|
|
||||||
" <td>83.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>MODERNA</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>012L20A</th>\n",
|
|
||||||
" <td>2357</td>\n",
|
|
||||||
" <td>57.0</td>\n",
|
|
||||||
" <td>29.0</td>\n",
|
|
||||||
" <td>22.0</td>\n",
|
|
||||||
" <td>135.0</td>\n",
|
|
||||||
" <td>1.0</td>\n",
|
|
||||||
" <td>MODERNA</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>...</th>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" <td>...</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>EN6207-</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>PFIZER\\BIONTECH</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>039820A</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>MODERNA</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>Blue-218</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>MODERNA</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>1808973</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>UNKNOWN MANUFACTURER</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" <tr>\n",
|
|
||||||
" <th>FJ1161</th>\n",
|
|
||||||
" <td>1</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>0.0</td>\n",
|
|
||||||
" <td>PFIZER\\BIONTECH</td>\n",
|
|
||||||
" </tr>\n",
|
|
||||||
" </tbody>\n",
|
|
||||||
"</table>\n",
|
|
||||||
"<p>18428 rows × 7 columns</p>\n",
|
|
||||||
"</div>"
|
|
||||||
],
|
|
||||||
"text/plain": [
|
|
||||||
" ADRs DEATHS DISABILITIES LIFE THREATENING ILLNESSES \\\n",
|
|
||||||
"VAX_LOT \n",
|
|
||||||
"026L20A 3335 25.0 24.0 21.0 \n",
|
|
||||||
"039K20A 3335 67.0 22.0 29.0 \n",
|
|
||||||
"011J20A 3078 34.0 27.0 26.0 \n",
|
|
||||||
"025L20A 2397 42.0 16.0 26.0 \n",
|
|
||||||
"012L20A 2357 57.0 29.0 22.0 \n",
|
|
||||||
"... ... ... ... ... \n",
|
|
||||||
"EN6207- 1 0.0 0.0 0.0 \n",
|
|
||||||
"039820A 1 0.0 0.0 0.0 \n",
|
|
||||||
"Blue-218 1 0.0 0.0 0.0 \n",
|
|
||||||
"1808973 1 0.0 0.0 0.0 \n",
|
|
||||||
"FJ1161 1 0.0 0.0 0.0 \n",
|
|
||||||
"\n",
|
|
||||||
" HOSPITALISATIONS EMERGENCY ROOM OR DOCTOR VISITS \\\n",
|
|
||||||
"VAX_LOT \n",
|
|
||||||
"026L20A 125.0 0.0 \n",
|
|
||||||
"039K20A 134.0 0.0 \n",
|
|
||||||
"011J20A 106.0 0.0 \n",
|
|
||||||
"025L20A 83.0 0.0 \n",
|
|
||||||
"012L20A 135.0 1.0 \n",
|
|
||||||
"... ... ... \n",
|
|
||||||
"EN6207- 0.0 0.0 \n",
|
|
||||||
"039820A 0.0 0.0 \n",
|
|
||||||
"Blue-218 0.0 0.0 \n",
|
|
||||||
"1808973 0.0 0.0 \n",
|
|
||||||
"FJ1161 0.0 0.0 \n",
|
|
||||||
"\n",
|
|
||||||
" COMPANY \n",
|
|
||||||
"VAX_LOT \n",
|
|
||||||
"026L20A MODERNA \n",
|
|
||||||
"039K20A MODERNA \n",
|
|
||||||
"011J20A MODERNA \n",
|
|
||||||
"025L20A MODERNA \n",
|
|
||||||
"012L20A MODERNA \n",
|
|
||||||
"... ... \n",
|
|
||||||
"EN6207- PFIZER\\BIONTECH \n",
|
|
||||||
"039820A MODERNA \n",
|
|
||||||
"Blue-218 MODERNA \n",
|
|
||||||
"1808973 UNKNOWN MANUFACTURER \n",
|
|
||||||
"FJ1161 PFIZER\\BIONTECH \n",
|
|
||||||
"\n",
|
|
||||||
"[18428 rows x 7 columns]"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"metadata": {},
|
|
||||||
"output_type": "display_data"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"saveSevereEffectsBatchCodeTable('results/severeEffects.xlsx')"
|
"saveSevereEffectsBatchCodeTable('results/severeEffects.xlsx')"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user