renaming columns

This commit is contained in:
frankknoll
2022-02-15 21:04:10 +01:00
parent f8b3b8915f
commit bcacc211f6
3 changed files with 11 additions and 11 deletions

View File

@@ -20,7 +20,7 @@
'Disabilities': 3,
'Life Threatening Illnesses': 4,
'Company': 5,
'Lethality (%)': 6
'Lethality': 6
};
$('#batchCodeTable').DataTable(
{
@@ -46,7 +46,7 @@
columnIndex['Disabilities'],
columnIndex['Life Threatening Illnesses'],
columnIndex['Company'],
columnIndex['Lethality (%)']
columnIndex['Lethality']
]
},
{
@@ -54,7 +54,7 @@
const lethality = parseFloat(data);
return !isNaN(lethality) ? lethality.toFixed(2) + " %" : '';
},
targets: [columnIndex['Lethality (%)']]
targets: [columnIndex['Lethality']]
}
]
});
@@ -87,7 +87,7 @@
<th>Disabilities</th>
<th>Life Threatening Illnesses</th>
<th>Company</th>
<th>Lethality (%)</th>
<th>Lethality</th>
</tr>
</thead>
</table>

File diff suppressed because one or more lines are too long

View File

@@ -239,10 +239,10 @@
" 'Disabilities',\n",
" 'Life Threatening Illnesses',\n",
" 'Company',\n",
" 'Lethality (%)'\n",
" 'Lethality'\n",
" ]]\n",
" if minADRsForLethality is not None:\n",
" batchCodeTable.loc[batchCodeTable['Total Number of Adverse Reaction Reports'] < minADRsForLethality, 'Lethality (%)'] = np.nan\n",
" batchCodeTable.loc[batchCodeTable['Total Number of Adverse Reaction Reports'] < minADRsForLethality, 'Lethality'] = np.nan\n",
" return batchCodeTable\n",
"\n",
" # create table from https://www.howbadismybatch.com/combined.html\n",
@@ -264,7 +264,7 @@
" @staticmethod\n",
" def _createSummationTableByVAX_LOT(dataFrame):\n",
" batchCodeTable = SummationTableFactory.createSummationTable(dataFrame.groupby('VAX_LOT'))\n",
" batchCodeTable['Lethality (%)'] = batchCodeTable['Deaths'] / batchCodeTable['Total Number of Adverse Reaction Reports'] * 100\n",
" batchCodeTable['Lethality'] = batchCodeTable['Deaths'] / batchCodeTable['Total Number of Adverse Reaction Reports'] * 100\n",
" batchCodeTable = batchCodeTable[\n",
" [\n",
" 'Total Number of Adverse Reaction Reports',\n",
@@ -273,7 +273,7 @@
" 'Life Threatening Illnesses',\n",
" 'Hospitalisations',\n",
" 'Emergency Room or Doctor Visits',\n",
" 'Lethality (%)'\n",
" 'Lethality'\n",
" ]]\n",
" batchCodeTable = batchCodeTable.sort_values(by = 'Total Number of Adverse Reaction Reports', ascending = False)\n",
" return BatchCodeTableFactory._addCompanyColumn(batchCodeTable, BatchCodeTableFactory._createCompanyByBatchCodeTable(dataFrame))\n",
@@ -845,7 +845,7 @@
" 'Disabilities': [2, 0],\n",
" 'Life Threatening Illnesses': [0, 0],\n",
" 'Company': ['MODERNA', 'MODERNA'],\n",
" 'Lethality (%)': [0/2 * 100, np.nan]\n",
" 'Lethality': [0/2 * 100, np.nan]\n",
" },\n",
" index = pd.Index(['025L20A', '037K20A'], name = 'VAX_LOT'))\n",
" assert_frame_equal(batchCodeTable, batchCodeTableExpected, check_dtype = False)\n",
@@ -870,7 +870,7 @@
" 'Disabilities': [2, 0],\n",
" 'Life Threatening Illnesses': [0, 0],\n",
" 'Company': ['MODERNA', 'MODERNA'],\n",
" 'Lethality (%)': [0/2 * 100, 1/1 * 100]\n",
" 'Lethality': [0/2 * 100, 1/1 * 100]\n",
" },\n",
" index = pd.Index(['025L20A', '037K20A'], name = 'VAX_LOT'))\n",
" assert_frame_equal(batchCodeTable, batchCodeTableExpected, check_dtype = False)\n"