Files
HowBadIsMyBatch/HowBadIsMyBatch.ipynb
2022-01-24 12:16:58 +01:00

242 lines
4.8 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "9de5907f-18f5-4cb1-903e-26028ff1fa03",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"pd.set_option('display.max_rows', 100)\n",
"pd.set_option('display.max_columns', None)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ad0e6044",
"metadata": {},
"outputs": [],
"source": [
"df_patients_22 = pd.read_csv(\"VAERS/2021VAERSData/2021VAERSDATA.csv\", index_col='VAERS_ID', encoding='latin1', low_memory=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4472e902",
"metadata": {},
"outputs": [],
"source": [
"df_patients_22.index\n",
"df_patients_22"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fb54ec47",
"metadata": {},
"outputs": [],
"source": [
"df_vax_22 = pd.read_csv(\"VAERS/2021VAERSData/2021VAERSVAX.csv\", index_col='VAERS_ID', encoding='latin1')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d8942466",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"df_vax_22"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d31c5225",
"metadata": {},
"outputs": [],
"source": [
"df_COVID19_22 = df_vax_22[df_vax_22[\"VAX_TYPE\"] == \"COVID19\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "be2b57c9",
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"df_COVID19_22"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8c432ab2",
"metadata": {},
"outputs": [],
"source": [
"df_patients_COVID19 = pd.merge(df_patients_22, df_COVID19_22, left_index=True, right_index=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fef882ff",
"metadata": {},
"outputs": [],
"source": [
"df_patients_22.shape, df_COVID19_22.shape, df_patients_COVID19.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6ce15322",
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"# pd.set_option('display.max_rows', 100)\n",
"df_patients_COVID19"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "233bc590",
"metadata": {},
"outputs": [],
"source": [
"df_PFIZER_BIONTECH = df_patients_COVID19[df_patients_COVID19[\"VAX_MANU\"] == \"MODERNA\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "86e0e4f2",
"metadata": {},
"outputs": [],
"source": [
"df_PFIZER_BIONTECH.info()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0ad4aab2",
"metadata": {},
"outputs": [],
"source": [
"df_PFIZER_BIONTECH"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "349da946",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"df_DIED = df_PFIZER_BIONTECH[df_PFIZER_BIONTECH['DIED']=='Y'][['VAX_LOT']]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2f660707",
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"df_DISABLE = df_PFIZER_BIONTECH[df_PFIZER_BIONTECH['DISABLE']=='Y'][['VAX_LOT']]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9f537710",
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"df_L_THREAT = df_PFIZER_BIONTECH[df_PFIZER_BIONTECH['L_THREAT']=='Y'][['VAX_LOT']]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f675fcfe",
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"df_ADR = df_PFIZER_BIONTECH[['VAX_LOT']]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "99945ca8",
"metadata": {},
"outputs": [],
"source": [
"df = pd.concat(\n",
" {\n",
" 'ADRs': df_ADR.value_counts(),\n",
" 'DEATHS': df_DIED.value_counts(),\n",
" 'DISABILITIES': df_DISABLE.value_counts(),\n",
" 'LIFE THREATENING ILLNESSES': df_L_THREAT.value_counts()\n",
" },\n",
" axis=1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d9191d12",
"metadata": {},
"outputs": [],
"source": [
"df"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}