renaming columns
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
'Disabilities': 3,
|
'Disabilities': 3,
|
||||||
'Life Threatening Illnesses': 4,
|
'Life Threatening Illnesses': 4,
|
||||||
'Company': 5,
|
'Company': 5,
|
||||||
'Lethality (%)': 6
|
'Lethality': 6
|
||||||
};
|
};
|
||||||
$('#batchCodeTable').DataTable(
|
$('#batchCodeTable').DataTable(
|
||||||
{
|
{
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
columnIndex['Disabilities'],
|
columnIndex['Disabilities'],
|
||||||
columnIndex['Life Threatening Illnesses'],
|
columnIndex['Life Threatening Illnesses'],
|
||||||
columnIndex['Company'],
|
columnIndex['Company'],
|
||||||
columnIndex['Lethality (%)']
|
columnIndex['Lethality']
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
const lethality = parseFloat(data);
|
const lethality = parseFloat(data);
|
||||||
return !isNaN(lethality) ? lethality.toFixed(2) + " %" : '';
|
return !isNaN(lethality) ? lethality.toFixed(2) + " %" : '';
|
||||||
},
|
},
|
||||||
targets: [columnIndex['Lethality (%)']]
|
targets: [columnIndex['Lethality']]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
<th>Disabilities</th>
|
<th>Disabilities</th>
|
||||||
<th>Life Threatening Illnesses</th>
|
<th>Life Threatening Illnesses</th>
|
||||||
<th>Company</th>
|
<th>Company</th>
|
||||||
<th>Lethality (%)</th>
|
<th>Lethality</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -239,10 +239,10 @@
|
|||||||
" 'Disabilities',\n",
|
" 'Disabilities',\n",
|
||||||
" 'Life Threatening Illnesses',\n",
|
" 'Life Threatening Illnesses',\n",
|
||||||
" 'Company',\n",
|
" 'Company',\n",
|
||||||
" 'Lethality (%)'\n",
|
" 'Lethality'\n",
|
||||||
" ]]\n",
|
" ]]\n",
|
||||||
" if minADRsForLethality is not None:\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",
|
" return batchCodeTable\n",
|
||||||
"\n",
|
"\n",
|
||||||
" # create table from https://www.howbadismybatch.com/combined.html\n",
|
" # create table from https://www.howbadismybatch.com/combined.html\n",
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
" @staticmethod\n",
|
" @staticmethod\n",
|
||||||
" def _createSummationTableByVAX_LOT(dataFrame):\n",
|
" def _createSummationTableByVAX_LOT(dataFrame):\n",
|
||||||
" batchCodeTable = SummationTableFactory.createSummationTable(dataFrame.groupby('VAX_LOT'))\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",
|
" batchCodeTable = batchCodeTable[\n",
|
||||||
" [\n",
|
" [\n",
|
||||||
" 'Total Number of Adverse Reaction Reports',\n",
|
" 'Total Number of Adverse Reaction Reports',\n",
|
||||||
@@ -273,7 +273,7 @@
|
|||||||
" 'Life Threatening Illnesses',\n",
|
" 'Life Threatening Illnesses',\n",
|
||||||
" 'Hospitalisations',\n",
|
" 'Hospitalisations',\n",
|
||||||
" 'Emergency Room or Doctor Visits',\n",
|
" 'Emergency Room or Doctor Visits',\n",
|
||||||
" 'Lethality (%)'\n",
|
" 'Lethality'\n",
|
||||||
" ]]\n",
|
" ]]\n",
|
||||||
" batchCodeTable = batchCodeTable.sort_values(by = 'Total Number of Adverse Reaction Reports', ascending = False)\n",
|
" batchCodeTable = batchCodeTable.sort_values(by = 'Total Number of Adverse Reaction Reports', ascending = False)\n",
|
||||||
" return BatchCodeTableFactory._addCompanyColumn(batchCodeTable, BatchCodeTableFactory._createCompanyByBatchCodeTable(dataFrame))\n",
|
" return BatchCodeTableFactory._addCompanyColumn(batchCodeTable, BatchCodeTableFactory._createCompanyByBatchCodeTable(dataFrame))\n",
|
||||||
@@ -845,7 +845,7 @@
|
|||||||
" 'Disabilities': [2, 0],\n",
|
" 'Disabilities': [2, 0],\n",
|
||||||
" 'Life Threatening Illnesses': [0, 0],\n",
|
" 'Life Threatening Illnesses': [0, 0],\n",
|
||||||
" 'Company': ['MODERNA', 'MODERNA'],\n",
|
" 'Company': ['MODERNA', 'MODERNA'],\n",
|
||||||
" 'Lethality (%)': [0/2 * 100, np.nan]\n",
|
" 'Lethality': [0/2 * 100, np.nan]\n",
|
||||||
" },\n",
|
" },\n",
|
||||||
" index = pd.Index(['025L20A', '037K20A'], name = 'VAX_LOT'))\n",
|
" index = pd.Index(['025L20A', '037K20A'], name = 'VAX_LOT'))\n",
|
||||||
" assert_frame_equal(batchCodeTable, batchCodeTableExpected, check_dtype = False)\n",
|
" assert_frame_equal(batchCodeTable, batchCodeTableExpected, check_dtype = False)\n",
|
||||||
@@ -870,7 +870,7 @@
|
|||||||
" 'Disabilities': [2, 0],\n",
|
" 'Disabilities': [2, 0],\n",
|
||||||
" 'Life Threatening Illnesses': [0, 0],\n",
|
" 'Life Threatening Illnesses': [0, 0],\n",
|
||||||
" 'Company': ['MODERNA', 'MODERNA'],\n",
|
" 'Company': ['MODERNA', 'MODERNA'],\n",
|
||||||
" 'Lethality (%)': [0/2 * 100, 1/1 * 100]\n",
|
" 'Lethality': [0/2 * 100, 1/1 * 100]\n",
|
||||||
" },\n",
|
" },\n",
|
||||||
" index = pd.Index(['025L20A', '037K20A'], name = 'VAX_LOT'))\n",
|
" index = pd.Index(['025L20A', '037K20A'], name = 'VAX_LOT'))\n",
|
||||||
" assert_frame_equal(batchCodeTable, batchCodeTableExpected, check_dtype = False)\n"
|
" assert_frame_equal(batchCodeTable, batchCodeTableExpected, check_dtype = False)\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user