From 172ce898a81bfdd99aa1ffe3b55e5c555f5d9c51 Mon Sep 17 00:00:00 2001 From: frankknoll Date: Tue, 15 Feb 2022 12:20:27 +0100 Subject: [PATCH] refactoring --- src/HowBadIsMyBatch.ipynb | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/HowBadIsMyBatch.ipynb b/src/HowBadIsMyBatch.ipynb index 49c75820686..f3f6cb49575 100644 --- a/src/HowBadIsMyBatch.ipynb +++ b/src/HowBadIsMyBatch.ipynb @@ -367,9 +367,8 @@ " \n", " @staticmethod\n", " def addSevereColumn(dataFrame):\n", - " dataFrame['SEVERE'] = dataFrame.apply(\n", - " lambda row: 1 if (row['DIED'] + row['L_THREAT'] + row['DISABLE']) > 0 else 0,\n", - " axis = 'columns')\n", + " dataFrame['SEVERE'] = (dataFrame['DIED'] + dataFrame['L_THREAT'] + dataFrame['DISABLE']) > 0\n", + " dataFrame['SEVERE'].replace({True: 1, False: 0}, inplace = True)\n", " return dataFrame\n" ] }, @@ -1387,14 +1386,6 @@ "\n", "sns.boxplot(x = \"CONCENTRATION\", y = \"Total Number of Adverse Reaction Reports\", data = batchCodeTable, order = order)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c355356a", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {