El análisis de estos datos está limitado a 40.787 registros accesibles de los 42.114 disponibles en adrreports.eu con fecha 26/12/2021. Se analiza el evento muerte asociado a la inoculación de la vacuna Janssen.
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\\Janssen\\Run Line Listing Report Janssen.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-10010987339 | Spontaneous | 2021-12-17 00:00:00 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Female | COVID-19 (n/a - Unknown - Other Medically Impo... | COVID-19 VACCINE (AD26.COV2-S [RECOMBINANT]) J... | Not reported | <a target="_blank" href="https://dap.ema.europ... |
1 | EU-EC-10010987381 | Spontaneous | 2021-12-17 00:00:00 | Non Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Male | Chills (30h - Recovered/Resolved - ),<BR><BR>D... | COVID-19 VACCINE JANSSEN (AD26.COV2.S) [COVID-... | Not reported | <a target="_blank" href="https://dap.ema.europ... |
2 | EU-EC-10010987420 | Spontaneous | 2021-12-17 00:00:00 | Non Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Male | Chills (n/a - Recovered/Resolved - ),<BR><BR>D... | COMIRNATY [TOZINAMERAN] (S - Immunisation - n/... | 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: 40787 entries, 0 to 40786 Data columns (total 14 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 EU Local Number 40787 non-null object 1 Report Type 40787 non-null object 2 EV Gateway Receipt Date 40787 non-null object 3 Primary Source Qualification 40787 non-null object 4 Primary Source Country for Regulatory Purposes 40787 non-null object 5 Literature Reference 40787 non-null object 6 Patient Age Group 40787 non-null object 7 Patient Age Group (as per reporter) 40787 non-null object 8 Parent Child Report 40787 non-null object 9 Patient Sex 40787 non-null object 10 Reaction List PT (Duration – Outcome - Seriousness Criteria) 40787 non-null object 11 Suspect/interacting Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 40787 non-null object 12 Concomitant/Not Administered Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 40787 non-null object 13 ICSR Form 40787 non-null object dtypes: object(14) memory usage: 4.4+ 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 | 40787 | 40787 | 40787 | 40787 | 40787 | 40787 | 40787 | 40787 | 40787 | 40787 | 40787 | 40787 | 40787 | 40787 |
unique | 40787 | 1 | 271 | 2 | 2 | 68 | 8 | 8 | 2 | 3 | 30837 | 654 | 4544 | 40787 |
top | EU-EC-10010987339 | Spontaneous | 2021-10-26 00:00:00 | Non Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Female | COVID-19 (n/a - Unknown - Other Medically Impo... | COVID-19 VACCINE JANSSEN (AD26.COV2.S) [COVID-... | Not reported | <a target="_blank" href="https://dap.ema.europ... |
freq | 1 | 40787 | 1293 | 29283 | 33137 | 40718 | 34411 | 19127 | 40772 | 23485 | 1841 | 9753 | 33237 | 1 |
#No hay valores faltantes en el conjunto de datos
df.isnull().sum()
EU Local Number 0 Report Type 0 EV Gateway Receipt Date 0 Primary Source Qualification 0 Primary Source Country for Regulatory Purposes 0 Literature Reference 0 Patient Age Group 0 Patient Age Group (as per reporter) 0 Parent Child Report 0 Patient Sex 0 Reaction List PT (Duration – Outcome - Seriousness Criteria) 0 Suspect/interacting Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 0 Concomitant/Not Administered Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 0 ICSR Form 0 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: 40787 entries, 0 to 40786 Data columns (total 14 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 eu_local_number 40787 non-null object 1 report_type 40787 non-null category 2 ev_gateway_receipt_date 40787 non-null datetime64[ns] 3 primary_source_qualification 40787 non-null category 4 primary_source_country_for_regulatory_purposes 40787 non-null object 5 literature_reference 40787 non-null object 6 patient_age_group 40787 non-null category 7 patient_age_group_as_per_reporter 40787 non-null category 8 parent_child_report 40787 non-null category 9 patient_sex 40787 non-null category 10 reaction_list_pt__duration_–_outcome_seriousness_criteria 40787 non-null object 11 suspect/interacting_drug_list__drug_char_indication_pt_action_taken_[_duration_dose_route] 40787 non-null object 12 concomitant/_not_administered_drug_list__drug_char_indication_pt_action_taken_[_duration_dose_route] 40787 non-null object 13 icsr_form 40787 non-null object dtypes: category(6), datetime64[ns](1), object(7) memory usage: 2.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 |
---|
#Total muertes encontradas en el grupo de 0 a 1 mes
len(babys)
0
#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 |
---|
#Total muertes encontradas en el grupo de 2 meses a 2 años
len(nenes)
0
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
3832 | EU-EC-10010696156 | Spontaneous | 2021-11-19 | Non Healthcare Professional | Non European Economic Area | Not available | 12-17 Years | Adolescent | No | Male |
#Total muertes encontradas en el grupo de 12 a 17 años
len(jovenes)
1
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
63 | EU-EC-10010993060 | Spontaneous | 2021-12-17 | Non Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Male |
72 | EU-EC-10010993624 | Spontaneous | 2021-12-17 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Male |
157 | EU-EC-10010976120 | Spontaneous | 2021-12-16 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Female |
169 | EU-EC-10010977554 | Spontaneous | 2021-12-16 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Female |
258 | EU-EC-10010985106 | Spontaneous | 2021-12-16 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
40653 | EU-EC-10008354029 | Spontaneous | 2021-04-18 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Not Specified |
40667 | EU-EC-10008320174 | Spontaneous | 2021-04-15 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Male |
40742 | EU-EC-10008138926 | Spontaneous | 2021-03-30 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Female |
40748 | EU-EC-10008124253 | Spontaneous | 2021-03-29 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Male |
40781 | EU-EC-10007998037 | Spontaneous | 2021-03-19 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Female |
442 rows × 10 columns
#Total muertes encontradas en el grupo de 18 a 64 años
len(adultos)
442
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
149 | EU-EC-10010974960 | Spontaneous | 2021-12-16 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
151 | EU-EC-10010975043 | Spontaneous | 2021-12-16 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
252 | EU-EC-10010984526 | Spontaneous | 2021-12-16 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Female |
277 | EU-EC-10010986272 | Spontaneous | 2021-12-16 | Healthcare Professional | European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
293 | EU-EC-10010958287 | Spontaneous | 2021-12-15 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Female |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
40372 | EU-EC-10008435932 | Spontaneous | 2021-04-26 | Non Healthcare Professional | European Economic Area | Not available | 65-85 Years | Not Specified | No | Not Specified |
40599 | EU-EC-10008402011 | Spontaneous | 2021-04-22 | Non Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Female |
40655 | EU-EC-10008354062 | Spontaneous | 2021-04-18 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Female |
40694 | EU-EC-10008242642 | Spontaneous | 2021-04-08 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
40747 | EU-EC-10008124252 | Spontaneous | 2021-03-29 | Non Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
329 rows × 10 columns
#Total muertes encontradas en el grupo de 65 a 85 años
len(mayores)
329
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
196 | EU-EC-10010979187 | Spontaneous | 2021-12-16 | Healthcare Professional | European Economic Area | Not available | More than 85 Years | Elderly | No | Female |
1295 | EU-EC-10010877520 | Spontaneous | 2021-12-07 | Non Healthcare Professional | European Economic Area | Not available | More than 85 Years | Elderly | No | Female |
1400 | EU-EC-10010863361 | Spontaneous | 2021-12-06 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Elderly | No | Female |
2207 | EU-EC-10010807643 | Spontaneous | 2021-11-30 | Non Healthcare Professional | European Economic Area | Not available | More than 85 Years | Elderly | No | Female |
2356 | EU-EC-10010785509 | Spontaneous | 2021-11-28 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Elderly | No | Female |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
39645 | EU-EC-10008492675 | Spontaneous | 2021-04-30 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Elderly | No | Female |
39727 | EU-EC-10008494053 | Spontaneous | 2021-04-30 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Elderly | No | Male |
39972 | EU-EC-10008479980 | Spontaneous | 2021-04-29 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Elderly | No | Male |
40704 | EU-EC-10008195117 | Spontaneous | 2021-04-05 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Elderly | No | Female |
40709 | EU-EC-10008197653 | Spontaneous | 2021-04-05 | Non Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Elderly | No | Female |
70 rows × 10 columns
#Total muertes encontradas en el grupo de más de 85 años
len(abuelos)
70
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
138 | EU-EC-10010974623 | Spontaneous | 2021-12-16 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
153 | EU-EC-10010975327 | Spontaneous | 2021-12-16 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Male |
305 | EU-EC-10010958747 | Spontaneous | 2021-12-15 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
307 | EU-EC-10010959090 | Spontaneous | 2021-12-15 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Male |
320 | EU-EC-10010960158 | Spontaneous | 2021-12-15 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
40656 | EU-EC-10008352823 | Spontaneous | 2021-04-17 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Male |
40663 | EU-EC-10008338912 | Spontaneous | 2021-04-16 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
40722 | EU-EC-10008164806 | Spontaneous | 2021-04-01 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Male |
40731 | EU-EC-10008152972 | Spontaneous | 2021-03-31 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
40736 | EU-EC-10008135660 | Spontaneous | 2021-03-30 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
106 rows × 10 columns
#Total muertes encontradas en grupo de edad NO ESPECIFICADA
len(no_especificado)
106
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
63 | EU-EC-10010993060 | Spontaneous | 2021-12-17 | Non Healthcare Professional | European Economic Area | Not available | 18-64 Years | Adult | No | Male |
72 | EU-EC-10010993624 | Spontaneous | 2021-12-17 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Male |
138 | EU-EC-10010974623 | Spontaneous | 2021-12-16 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
149 | EU-EC-10010974960 | Spontaneous | 2021-12-16 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
151 | EU-EC-10010975043 | Spontaneous | 2021-12-16 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
40736 | EU-EC-10008135660 | Spontaneous | 2021-03-30 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
40742 | EU-EC-10008138926 | Spontaneous | 2021-03-30 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Female |
40747 | EU-EC-10008124252 | Spontaneous | 2021-03-29 | Non Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
40748 | EU-EC-10008124253 | Spontaneous | 2021-03-29 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Male |
40781 | EU-EC-10007998037 | Spontaneous | 2021-03-19 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Adult | No | Female |
948 rows × 10 columns
#Total muertes encontradas TOTALES
len(todos)
948
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 | |
---|---|---|
0 | 0-1 Month | 0 |
3 | 2 Months - 2 Years | 0 |
4 | 3-11 Years | 0 |
1 | 12-17 Years | 1 |
6 | More than 85 Years | 70 |
7 | Not Specified | 106 |
5 | 65-85 Years | 329 |
2 | 18-64 Years | 442 |
fig = px.bar(df_group, x='Grupo de edad', y='Nº muertes')
fig.update_layout(
title={
'text':'<b>Evento de muerte asociado a la vacuna Janssen 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='#9966ff'
)
)
fig.update_traces(marker_color='#9966ff',
hovertemplate = 'Muertes: %{y}'+'<br>Rango edad: %{x}')