El análisis de estos datos está limitado a 249.900 registros accesibles de los 425.561 disponibles en adrreports.eu con fecha 26/12/2021. Se analiza el evento muerte asociado a la inoculación de la vacuna Astrazeneca (Vaxzebria).
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import warnings
fig = go.Figure()
warnings.filterwarnings('ignore')
#Lectura del archivo CSV de Moderna
df = pd.read_csv("..\\..\\..\\..\\Desktop\\Vacunas\\Astrazeneca\\Run Line Listing Report Astrazeneca.csv")
df.head(3)
EU Local Number | Report Type | EV Gateway Receipt Date | Primary Source Qualification | Primary Source Country for Regulatory Purposes | Literature Reference | Patient Age Group | Patient Age Group (as per reporter) | Parent Child Report | Patient Sex | Reaction List PT (Duration – Outcome - Seriousness Criteria) | Suspect/interacting Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) | Concomitant/Not Administered Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) | ICSR Form | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | EU-EC-10010985640 | Spontaneous | 2021-12-17 00:00:00 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Female | Haemorrhage (n/a - Not Recovered/Not Resolved ... | COVID-19 VACCINE ASTRAZENECA (CHADOX1 NCOV-19)... | [BECLOMETASONE DIPROPIONATE, FORMOTEROL FUMARA... | <a target="_blank" href="https://dap.ema.europ... |
1 | EU-EC-10010987198 | Spontaneous | 2021-12-17 00:00:00 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Female | Acute myocardial infarction (n/a - Recovered/R... | VAXZEVRIA [COVID-19 VACCINE ASTRAZENECA (CHADO... | Not reported | <a target="_blank" href="https://dap.ema.europ... |
2 | EU-EC-10010987200 | Spontaneous | 2021-12-17 00:00:00 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male | Pulmonary embolism (n/a - Unknown - Caused/Pro... | COVID-19 VACCINE ASTRAZENECA (CHADOX1 NCOV-19)... | Not reported | <a target="_blank" href="https://dap.ema.europ... |
#Información del tipo de variables, datos faltantes y ocupación de memoria.
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 249904 entries, 0 to 249903 Data columns (total 14 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 EU Local Number 249904 non-null object 1 Report Type 249900 non-null object 2 EV Gateway Receipt Date 249900 non-null object 3 Primary Source Qualification 249900 non-null object 4 Primary Source Country for Regulatory Purposes 249900 non-null object 5 Literature Reference 249900 non-null object 6 Patient Age Group 249900 non-null object 7 Patient Age Group (as per reporter) 249900 non-null object 8 Parent Child Report 249900 non-null object 9 Patient Sex 249900 non-null object 10 Reaction List PT (Duration – Outcome - Seriousness Criteria) 249900 non-null object 11 Suspect/interacting Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 249900 non-null object 12 Concomitant/Not Administered Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 249900 non-null object 13 ICSR Form 249900 non-null object dtypes: object(14) memory usage: 26.7+ MB
#Estadísticas generales no demasiado útiles en este conjunto de datos
df.describe()
EU Local Number | Report Type | EV Gateway Receipt Date | Primary Source Qualification | Primary Source Country for Regulatory Purposes | Literature Reference | Patient Age Group | Patient Age Group (as per reporter) | Parent Child Report | Patient Sex | Reaction List PT (Duration – Outcome - Seriousness Criteria) | Suspect/interacting Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) | Concomitant/Not Administered Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) | ICSR Form | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
count | 249904 | 249900 | 249900 | 249900 | 249900 | 249900 | 249900 | 249900 | 249900 | 249900 | 249900 | 249900 | 249900 | 249900 |
unique | 249904 | 1 | 244 | 2 | 2 | 269 | 8 | 8 | 2 | 3 | 179146 | 4242 | 35708 | 249900 |
top | EU-EC-10010985640 | Spontaneous | 2021-06-04 00:00:00 | Non Healthcare Professional | European Economic Area | Not available | 18-64 Years | Not Specified | No | Female | COVID-19 (n/a - Unknown - Other Medically Impo... | COVID-19 VACCINE ASTRAZENECA (CHADOX1 NCOV-19)... | Not reported | <a target="_blank" href="https://dap.ema.europ... |
freq | 1 | 249900 | 7083 | 178373 | 166310 | 249583 | 189882 | 158006 | 249753 | 171548 | 3431 | 53688 | 194529 | 1 |
#Hay valores faltantes en el conjunto de datos
df.isnull().sum()
EU Local Number 0 Report Type 4 EV Gateway Receipt Date 4 Primary Source Qualification 4 Primary Source Country for Regulatory Purposes 4 Literature Reference 4 Patient Age Group 4 Patient Age Group (as per reporter) 4 Parent Child Report 4 Patient Sex 4 Reaction List PT (Duration – Outcome - Seriousness Criteria) 4 Suspect/interacting Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 4 Concomitant/Not Administered Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 4 ICSR Form 4 dtype: int64
#Normalización de nombres de columnas (variables)
cols = df.columns.str.strip().str.replace('((?<=[a-z0-9])[A-Z]|(?!^)[A-Z](?=[a-z]))', r'_\1').str.lower().str.replace('[ _-]+', '_').str.replace('[}{)(><.!?\\\\:;,-]', '')
df.columns = cols
#Reasignación de variables tipo objeto a variables categoricas
df[['report_type', 'primary_source_qualification','patient_age_group','patient_age_group_as_per_reporter','parent_child_report','patient_sex']] = df[['report_type', 'primary_source_qualification','patient_age_group','patient_age_group_as_per_reporter','parent_child_report','patient_sex']].astype('category')
#Reasignación de variables tipo objeto a variables fecha
df['ev_gateway_receipt_date'] = pd.to_datetime(df['ev_gateway_receipt_date'], format='%Y-%m-%d %H:%M:%S')
#Verificación de la reasignación con la consuiguiente disminución de memoria
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 249904 entries, 0 to 249903 Data columns (total 14 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 eu_local_number 249904 non-null object 1 report_type 249900 non-null category 2 ev_gateway_receipt_date 249900 non-null datetime64[ns] 3 primary_source_qualification 249900 non-null category 4 primary_source_country_for_regulatory_purposes 249900 non-null object 5 literature_reference 249900 non-null object 6 patient_age_group 249900 non-null category 7 patient_age_group_as_per_reporter 249900 non-null category 8 parent_child_report 249900 non-null category 9 patient_sex 249900 non-null category 10 reaction_list_pt__duration_–_outcome_seriousness_criteria 249900 non-null object 11 suspect/interacting_drug_list__drug_char_indication_pt_action_taken_[_duration_dose_route] 249900 non-null object 12 concomitant/_not_administered_drug_list__drug_char_indication_pt_action_taken_[_duration_dose_route] 249900 non-null object 13 icsr_form 249900 non-null object dtypes: category(6), datetime64[ns](1), object(7) memory usage: 16.7+ MB
#Filtrado resultado de muerte en grupo de 0 a 1 mes
babys = df.loc[(df['patient_age_group'].isin(['0-1 Month'])) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
babys[['\ufeffeu_local_number', 'report_type','ev_gateway_receipt_date','primary_source_qualification','primary_source_country_for_regulatory_purposes','literature_reference','patient_age_group',
'patient_age_group_as_per_reporter',
'parent_child_report',
'patient_sex']]
eu_local_number | report_type | ev_gateway_receipt_date | primary_source_qualification | primary_source_country_for_regulatory_purposes | literature_reference | patient_age_group | patient_age_group_as_per_reporter | parent_child_report | patient_sex | |
---|---|---|---|---|---|---|---|---|---|---|
40451 | EU-EC-10010215836 | Spontaneous | 2021-10-05 | Non Healthcare Professional | European Economic Area | Not available | 0-1 Month | Not Specified | Yes | Male |
67921 | EU-EC-10009789688 | Spontaneous | 2021-08-25 | Non Healthcare Professional | Non European Economic Area | Not available | 0-1 Month | Not Specified | Yes | Not Specified |
106051 | EU-EC-10009320743 | Spontaneous | 2021-07-09 | Healthcare Professional | European Economic Area | Not available | 0-1 Month | Neonate (Preterm and Term newborns) | Yes | Male |
#Total muertes encontradas en el grupo de 0 a 1 mes
len(babys)
3
#Filtrado resultado de muerte en grupo de 2 meses a 2 años
nenes = df.loc[(df['patient_age_group'].isin(['2 Months - 2 Years'])) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
nenes[['\ufeffeu_local_number', 'report_type','ev_gateway_receipt_date','primary_source_qualification','primary_source_country_for_regulatory_purposes','literature_reference','patient_age_group',
'patient_age_group_as_per_reporter',
'parent_child_report',
'patient_sex']]
eu_local_number | report_type | ev_gateway_receipt_date | primary_source_qualification | primary_source_country_for_regulatory_purposes | literature_reference | patient_age_group | patient_age_group_as_per_reporter | parent_child_report | patient_sex | |
---|---|---|---|---|---|---|---|---|---|---|
7021 | EU-EC-10010878803 | Spontaneous | 2021-12-07 | Healthcare Professional | Non European Economic Area | Not available | 2 Months - 2 Years | Not Specified | Yes | Not Specified |
118496 | EU-EC-10009206279 | Spontaneous | 2021-06-30 | Non Healthcare Professional | Non European Economic Area | Not available | 2 Months - 2 Years | Not Specified | No | Female |
#Total muertes encontradas en el grupo de 2 meses a 2 años
len(nenes)
2
#Filtrado resultado de muerte en grupo de 3 a 11 años
ninos = df.loc[(df['patient_age_group'].isin(['3-11 Years'])) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
ninos[['\ufeffeu_local_number', 'report_type','ev_gateway_receipt_date','primary_source_qualification','primary_source_country_for_regulatory_purposes','literature_reference','patient_age_group',
'patient_age_group_as_per_reporter',
'parent_child_report',
'patient_sex']]
eu_local_number | report_type | ev_gateway_receipt_date | primary_source_qualification | primary_source_country_for_regulatory_purposes | literature_reference | patient_age_group | patient_age_group_as_per_reporter | parent_child_report | patient_sex |
---|
#Total muertes encontradas en el grupo de de 3 a 11 años
len(ninos)
0
#Filtrado resultado de muerte en grupo de 12 a 17 años
jovenes = df.loc[(df['patient_age_group'].isin(['12-17 Years'])) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
jovenes[['\ufeffeu_local_number', 'report_type','ev_gateway_receipt_date','primary_source_qualification','primary_source_country_for_regulatory_purposes','literature_reference','patient_age_group',
'patient_age_group_as_per_reporter',
'parent_child_report',
'patient_sex']]
eu_local_number | report_type | ev_gateway_receipt_date | primary_source_qualification | primary_source_country_for_regulatory_purposes | literature_reference | patient_age_group | patient_age_group_as_per_reporter | parent_child_report | patient_sex | |
---|---|---|---|---|---|---|---|---|---|---|
46808 | EU-EC-10010127333 | Spontaneous | 2021-09-24 | Healthcare Professional | Non European Economic Area | Not available | 12-17 Years | Not Specified | No | Male |
57604 | EU-EC-10010010062 | Spontaneous | 2021-09-15 | Healthcare Professional | Non European Economic Area | Not available | 12-17 Years | Not Specified | No | Female |
#Total muertes encontradas en el grupo de 12 a 17 años
len(jovenes)
2
#Filtrado resultado de muerte en grupo de 18 a 64 años
adultos = df.loc[(df['patient_age_group'].isin(['18-64 Years'])) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
adultos[['\ufeffeu_local_number', 'report_type','ev_gateway_receipt_date','primary_source_qualification','primary_source_country_for_regulatory_purposes','literature_reference','patient_age_group',
'patient_age_group_as_per_reporter',
'parent_child_report',
'patient_sex']]
eu_local_number | report_type | ev_gateway_receipt_date | primary_source_qualification | primary_source_country_for_regulatory_purposes | literature_reference | patient_age_group | patient_age_group_as_per_reporter | parent_child_report | patient_sex | |
---|---|---|---|---|---|---|---|---|---|---|
62 | EU-EC-10010988291 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
71 | EU-EC-10010988434 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
84 | EU-EC-10010988612 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
119 | EU-EC-10010989095 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
149 | EU-EC-10010989616 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Female |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
248279 | EU-EC-10008379640 | Spontaneous | 2021-04-20 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Female |
248791 | EU-EC-10008358308 | Spontaneous | 2021-04-19 | Non Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Male |
249148 | EU-EC-10008361393 | Spontaneous | 2021-04-19 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Male |
249180 | EU-EC-10008361585 | Spontaneous | 2021-04-19 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
249488 | EU-EC-10008365506 | Spontaneous | 2021-04-19 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Male |
1459 rows × 10 columns
#Total muertes encontradas en el grupo de 18 a 64 años
len(adultos)
1459
#Filtrado resultado de muerte en grupo de 65 a 85 años
mayores = df.loc[(df['patient_age_group'].isin(['65-85 Years'])) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
mayores[['\ufeffeu_local_number', 'report_type','ev_gateway_receipt_date','primary_source_qualification','primary_source_country_for_regulatory_purposes','literature_reference','patient_age_group',
'patient_age_group_as_per_reporter',
'parent_child_report',
'patient_sex']]
eu_local_number | report_type | ev_gateway_receipt_date | primary_source_qualification | primary_source_country_for_regulatory_purposes | literature_reference | patient_age_group | patient_age_group_as_per_reporter | parent_child_report | patient_sex | |
---|---|---|---|---|---|---|---|---|---|---|
199 | EU-EC-10010990065 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
247 | EU-EC-10010990231 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Female |
268 | EU-EC-10010990647 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
294 | EU-EC-10010991051 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
393 | EU-EC-10010992008 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
247045 | EU-EC-10008369705 | Spontaneous | 2021-04-20 | Non Healthcare Professional | European Economic Area | Not available | 65-85 Years | Elderly | No | Not Specified |
247081 | EU-EC-10008369846 | Spontaneous | 2021-04-20 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
247520 | EU-EC-10008372547 | Spontaneous | 2021-04-20 | Healthcare Professional | European Economic Area | Not available | 65-85 Years | Not Specified | No | Female |
247522 | EU-EC-10008372570 | Spontaneous | 2021-04-20 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Female |
247665 | EU-EC-10008374076 | Spontaneous | 2021-04-20 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Female |
1347 rows × 10 columns
#Total muertes encontradas en el grupo de 65 a 85 años
len(mayores)
1347
#Filtrado resultado de muerte en grupo de más de 85 años
abuelos = df.loc[(df['patient_age_group'].isin(['More than 85 Years'])) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
abuelos[['\ufeffeu_local_number', 'report_type','ev_gateway_receipt_date','primary_source_qualification','primary_source_country_for_regulatory_purposes','literature_reference','patient_age_group',
'patient_age_group_as_per_reporter',
'parent_child_report',
'patient_sex']]
eu_local_number | report_type | ev_gateway_receipt_date | primary_source_qualification | primary_source_country_for_regulatory_purposes | literature_reference | patient_age_group | patient_age_group_as_per_reporter | parent_child_report | patient_sex | |
---|---|---|---|---|---|---|---|---|---|---|
104 | EU-EC-10010988832 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Male |
1047 | EU-EC-10010978921 | Spontaneous | 2021-12-16 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
1107 | EU-EC-10010979473 | Spontaneous | 2021-12-16 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
1190 | EU-EC-10010980170 | Spontaneous | 2021-12-16 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
2560 | EU-EC-10010967642 | Spontaneous | 2021-12-15 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
244286 | EU-EC-10008402343 | Spontaneous | 2021-04-22 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Male |
244391 | EU-EC-10008403281 | Spontaneous | 2021-04-22 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Male |
246495 | EU-EC-10008393452 | Spontaneous | 2021-04-21 | Healthcare Professional | European Economic Area | Not available | More than 85 Years | Elderly | No | Female |
247962 | EU-EC-10008377428 | Spontaneous | 2021-04-20 | Non Healthcare Professional | European Economic Area | Not available | More than 85 Years | Elderly | No | Male |
249207 | EU-EC-10008361708 | Spontaneous | 2021-04-19 | Healthcare Professional | European Economic Area | Not available | More than 85 Years | Elderly | No | Male |
310 rows × 10 columns
#Total muertes encontradas en el grupo de más de 85 años
len(abuelos)
310
#Filtrado resultado de muerte en grupo de edad NO ESPECIFICADA
no_especificado = df.loc[(df['patient_age_group'].isin(['Not Specified'])) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
no_especificado[['\ufeffeu_local_number', 'report_type','ev_gateway_receipt_date','primary_source_qualification','primary_source_country_for_regulatory_purposes','literature_reference','patient_age_group',
'patient_age_group_as_per_reporter',
'parent_child_report',
'patient_sex']]
eu_local_number | report_type | ev_gateway_receipt_date | primary_source_qualification | primary_source_country_for_regulatory_purposes | literature_reference | patient_age_group | patient_age_group_as_per_reporter | parent_child_report | patient_sex | |
---|---|---|---|---|---|---|---|---|---|---|
123 | EU-EC-10010989210 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Male |
2927 | EU-EC-10010945598 | Spontaneous | 2021-12-14 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
2995 | EU-EC-10010947073 | Spontaneous | 2021-12-14 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
4269 | EU-EC-10010941914 | Spontaneous | 2021-12-13 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
4297 | EU-EC-10010942332 | Spontaneous | 2021-12-13 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
244415 | EU-EC-10008403593 | Spontaneous | 2021-04-22 | Non Healthcare Professional | European Economic Area | Not available | Not Specified | Not Specified | No | Female |
246744 | EU-EC-10008367969 | Spontaneous | 2021-04-20 | Non Healthcare Professional | European Economic Area | Not available | Not Specified | Not Specified | No | Male |
247048 | EU-EC-10008369712 | Spontaneous | 2021-04-20 | Healthcare Professional | European Economic Area | Not available | Not Specified | Elderly | No | Male |
247903 | EU-EC-10008376673 | Spontaneous | 2021-04-20 | Non Healthcare Professional | European Economic Area | Not available | Not Specified | Not Specified | No | Male |
249613 | EU-EC-10008366037 | Spontaneous | 2021-04-19 | Non Healthcare Professional | European Economic Area | Not available | Not Specified | Elderly | No | Female |
233 rows × 10 columns
#Total muertes encontradas en grupo de edad NO ESPECIFICADA
len(no_especificado)
233
#Filtrado resultado de muerte TOTALES
todos = df.loc[(df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
todos[['\ufeffeu_local_number', 'report_type','ev_gateway_receipt_date','primary_source_qualification','primary_source_country_for_regulatory_purposes','literature_reference','patient_age_group',
'patient_age_group_as_per_reporter',
'parent_child_report',
'patient_sex']]
eu_local_number | report_type | ev_gateway_receipt_date | primary_source_qualification | primary_source_country_for_regulatory_purposes | literature_reference | patient_age_group | patient_age_group_as_per_reporter | parent_child_report | patient_sex | |
---|---|---|---|---|---|---|---|---|---|---|
62 | EU-EC-10010988291 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
71 | EU-EC-10010988434 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
84 | EU-EC-10010988612 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
104 | EU-EC-10010988832 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Male |
119 | EU-EC-10010989095 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
249148 | EU-EC-10008361393 | Spontaneous | 2021-04-19 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Male |
249180 | EU-EC-10008361585 | Spontaneous | 2021-04-19 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
249207 | EU-EC-10008361708 | Spontaneous | 2021-04-19 | Healthcare Professional | European Economic Area | Not available | More than 85 Years | Elderly | No | Male |
249488 | EU-EC-10008365506 | Spontaneous | 2021-04-19 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Male |
249613 | EU-EC-10008366037 | Spontaneous | 2021-04-19 | Non Healthcare Professional | European Economic Area | Not available | Not Specified | Elderly | No | Female |
3356 rows × 10 columns
#Total muertes encontradas TOTALES
len(todos)
3356
df = df.loc[(((((((((((((((df['patient_age_group'].isin(['0-1 Month'])) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))) | (df['patient_age_group'].isin(['2 Months- 2 Years']))) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))) | (df['patient_age_group'].isin(['3-11 Years']))) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))) | (df['patient_age_group'].isin(['12-17 Years']))) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))) | (df['patient_age_group'].isin(['18-64 Years']))) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))) | (df['patient_age_group'].isin(['65-85 Years']))) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))) | (df['patient_age_group'].isin(['More than 85 Years']))) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))) | (df['patient_age_group'].isin(['Not Specified']))) & (df['reaction_list_pt__duration_–_outcome_seriousness_criteria'].str.contains('Results in Death', case=True, regex=False, na=False))]
#Creación de nueva columna basada en etiquetas de grupo de edad
df['patient_age_group_label'] = df['patient_age_group'].factorize(sort=False, na_sentinel=-1)[0]
#Agrupación de datos por rango de edad
df_group = df.groupby(['patient_age_group']).agg(patient_age_group_label_size=('patient_age_group_label', 'size')).reset_index()
df_group.rename(columns={'patient_age_group':'Grupo de edad',
'patient_age_group_label_size':'Nº muertes'}, inplace=True)
df_group.sort_values('Nº muertes', inplace=True)
df_group
Grupo de edad | Nº muertes | |
---|---|---|
3 | 2 Months - 2 Years | 0 |
4 | 3-11 Years | 0 |
1 | 12-17 Years | 2 |
0 | 0-1 Month | 3 |
7 | Not Specified | 233 |
6 | More than 85 Years | 310 |
5 | 65-85 Years | 1347 |
2 | 18-64 Years | 1459 |
fig = px.bar(df_group, x='Grupo de edad', y='Nº muertes')
fig.update_layout(
title={
'text':'<b>Evento de muertes asociadas a la vacuna Astrazeneca por rangos de edad</b>',
'y':0.92,
'x':0.5,
'xanchor':'center',
'yanchor':'top' },
xaxis_title='<b>Rango Edad</b>',
yaxis_title='<b>Nº. Muertes</b>',
font=dict(
size=12,
color='#c45911'
)
)
fig.update_traces(marker_color='#c45911',
hovertemplate = 'Muertes: %{y}'+'<br>Rango edad: %{x}')