renaming columns
This commit is contained in:
@@ -60,10 +60,10 @@
|
||||
<tr>
|
||||
<th>Batch</th>
|
||||
<th>Total Number of Adverse Reaction Reports</th>
|
||||
<th>DEATHS</th>
|
||||
<th>DISABILITIES</th>
|
||||
<th>LIFE THREATENING ILLNESSES</th>
|
||||
<th>COMPANY</th>
|
||||
<th>Deaths</th>
|
||||
<th>Disabilities</th>
|
||||
<th>Life Threatening Illnesses</th>
|
||||
<th>Company</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -180,11 +180,11 @@
|
||||
" # FK-TODO: rename \"ADRs\" and \"Total reports\" to \"Total Number of Adverse Reaction Reports\" in all places\n",
|
||||
" columnNameMappingsDict = {\n",
|
||||
" \"DIED_size\": \"Total Number of Adverse Reaction Reports\",\n",
|
||||
" \"DIED_sum\": \"DEATHS\",\n",
|
||||
" \"L_THREAT_sum\": \"LIFE THREATENING ILLNESSES\",\n",
|
||||
" \"DISABLE_sum\": \"DISABILITIES\",\n",
|
||||
" 'HOSPITAL_sum': 'HOSPITALISATIONS',\n",
|
||||
" 'ER_VISIT_sum': 'EMERGENCY ROOM OR DOCTOR VISITS'\n",
|
||||
" \"DIED_sum\": \"Deaths\",\n",
|
||||
" \"L_THREAT_sum\": \"Life Threatening Illnesses\",\n",
|
||||
" \"DISABLE_sum\": \"Disabilities\",\n",
|
||||
" 'HOSPITAL_sum': 'Hospitalisations',\n",
|
||||
" 'ER_VISIT_sum': 'Emergency Room or Doctor Visits'\n",
|
||||
" }):\n",
|
||||
"\n",
|
||||
" summationTable = groupBy.agg({\n",
|
||||
@@ -231,7 +231,7 @@
|
||||
" def createBatchCodeTable(dataFrame : pd.DataFrame, dose):\n",
|
||||
" dataFrame = DataFrameFilter().filterByCovid19(dataFrame)\n",
|
||||
" dataFrame = DataFrameFilter().filterBy(dataFrame, dose = dose)\n",
|
||||
" return BatchCodeTableFactory._createSummationTableByVAX_LOT(dataFrame)[['Total Number of Adverse Reaction Reports', 'DEATHS', 'DISABILITIES', 'LIFE THREATENING ILLNESSES', 'COMPANY']]\n",
|
||||
" return BatchCodeTableFactory._createSummationTableByVAX_LOT(dataFrame)[['Total Number of Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Company']]\n",
|
||||
"\n",
|
||||
" # create table from https://www.howbadismybatch.com/combined.html\n",
|
||||
" @staticmethod\n",
|
||||
@@ -243,7 +243,7 @@
|
||||
" @staticmethod\n",
|
||||
" def _createSummationTableByVAX_LOT(dataFrame):\n",
|
||||
" batchCodeTable = SummationTableFactory.createSummationTable(dataFrame.groupby('VAX_LOT'))\n",
|
||||
" batchCodeTable = batchCodeTable[['Total Number of Adverse Reaction Reports', 'DEATHS', 'DISABILITIES', 'LIFE THREATENING ILLNESSES', 'HOSPITALISATIONS', 'EMERGENCY ROOM OR DOCTOR VISITS']]\n",
|
||||
" batchCodeTable = batchCodeTable[['Total Number of Adverse Reaction Reports', 'Deaths', 'Disabilities', 'Life Threatening Illnesses', 'Hospitalisations', 'Emergency Room or Doctor Visits']]\n",
|
||||
" batchCodeTable = batchCodeTable.sort_values(by = 'Total Number of Adverse Reaction Reports', ascending = False)\n",
|
||||
" return BatchCodeTableFactory._addCompanyColumn(batchCodeTable, BatchCodeTableFactory._createCompanyByBatchCodeTable(dataFrame))\n",
|
||||
"\n",
|
||||
@@ -259,7 +259,7 @@
|
||||
"\n",
|
||||
" @staticmethod\n",
|
||||
" def _createCompanyByBatchCodeTable(dataFrame):\n",
|
||||
" return BatchCodeTableFactory._createManufacturerByBatchCodeTable(dataFrame).rename(columns = {\"VAX_MANU\": \"COMPANY\"})\n",
|
||||
" return BatchCodeTableFactory._createManufacturerByBatchCodeTable(dataFrame).rename(columns = {\"VAX_MANU\": \"Company\"})\n",
|
||||
"\n",
|
||||
" @staticmethod\n",
|
||||
" def _createManufacturerByBatchCodeTable(dataFrame):\n",
|
||||
@@ -692,12 +692,12 @@
|
||||
" batchCodeTableExpected = pd.DataFrame(\n",
|
||||
" data = {\n",
|
||||
" 'Total Number of Adverse Reaction Reports': [1, 1],\n",
|
||||
" 'DEATHS': [0, 1],\n",
|
||||
" 'DISABILITIES': [1, 0],\n",
|
||||
" 'LIFE THREATENING ILLNESSES': [0, 1],\n",
|
||||
" 'HOSPITALISATIONS': [0, 1],\n",
|
||||
" 'EMERGENCY ROOM OR DOCTOR VISITS': [1, 1],\n",
|
||||
" 'COMPANY': ['PFIZER\\BIONTECH', 'MODERNA']\n",
|
||||
" 'Deaths': [0, 1],\n",
|
||||
" 'Disabilities': [1, 0],\n",
|
||||
" 'Life Threatening Illnesses': [0, 1],\n",
|
||||
" 'Hospitalisations': [0, 1],\n",
|
||||
" 'Emergency Room or Doctor Visits': [1, 1],\n",
|
||||
" 'Company': ['PFIZER\\BIONTECH', 'MODERNA']\n",
|
||||
" },\n",
|
||||
" index = pd.Index(['025L20A', '037K20A'], name = 'VAX_LOT'))\n",
|
||||
" assert_frame_equal(batchCodeTable, batchCodeTableExpected, check_dtype = False)\n",
|
||||
@@ -756,10 +756,10 @@
|
||||
" batchCodeTableExpected = pd.DataFrame(\n",
|
||||
" data = {\n",
|
||||
" 'Total Number of Adverse Reaction Reports': [2, 1],\n",
|
||||
" 'DEATHS': [0, 1],\n",
|
||||
" 'DISABILITIES': [2, 0],\n",
|
||||
" 'LIFE THREATENING ILLNESSES': [0, 0],\n",
|
||||
" 'COMPANY': ['MODERNA', 'MODERNA']\n",
|
||||
" 'Deaths': [0, 1],\n",
|
||||
" 'Disabilities': [2, 0],\n",
|
||||
" 'Life Threatening Illnesses': [0, 0],\n",
|
||||
" 'Company': ['MODERNA', 'MODERNA']\n",
|
||||
" },\n",
|
||||
" index = pd.Index(['025L20A', '037K20A'], name = 'VAX_LOT'))\n",
|
||||
" assert_frame_equal(batchCodeTable, batchCodeTableExpected, check_dtype = False)\n"
|
||||
|
||||
Reference in New Issue
Block a user