El análisis de estos datos está limitado a 174.388 registros accesibles de los 182.225 disponibles en adrreports.eu con fecha 26/12/2021. Se analiza el evento muerte asociado a la inoculación de la vacuna Moderna.
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\\Moderna\\Run Line Listing Report Moderna.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-10010987338 | Spontaneous | 2021-12-17 00:00:00 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Female | Blood glucose increased (n/a - Not Recovered/N... | COVID-19 MRNA VACCINE MODERNA (CX-024414) [COV... | Not reported | <a target="_blank" href="https://dap.ema.europ... |
2 | EU-EC-10010987352 | Spontaneous | 2021-12-17 00:00:00 | Healthcare Professional | European Economic Area | Not available | 18-64 Years | Not Specified | No | Female | Hyperventilation (n/a - Unknown - ),<BR><BR>Ma... | SPIKEVAX [COVID-19 MRNA VACCINE MODERNA (CX-02... | 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: 174388 entries, 0 to 174387 Data columns (total 14 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 EU Local Number 174388 non-null object 1 Report Type 174388 non-null object 2 EV Gateway Receipt Date 174388 non-null object 3 Primary Source Qualification 174388 non-null object 4 Primary Source Country for Regulatory Purposes 174388 non-null object 5 Literature Reference 174388 non-null object 6 Patient Age Group 174388 non-null object 7 Patient Age Group (as per reporter) 174388 non-null object 8 Parent Child Report 174388 non-null object 9 Patient Sex 174388 non-null object 10 Reaction List PT (Duration – Outcome - Seriousness Criteria) 174388 non-null object 11 Suspect/interacting Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 174388 non-null object 12 Concomitant/Not Administered Drug List (Drug Char - Indication PT - Action taken - [Duration - Dose - Route]) 174388 non-null object 13 ICSR Form 174388 non-null object dtypes: object(14) memory usage: 18.6+ 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 | 174388 | 174388 | 174388 | 174388 | 174388 | 174388 | 174388 | 174388 | 174388 | 174388 | 174388 | 174388 | 174388 | 174388 |
unique | 174388 | 1 | 340 | 2 | 2 | 242 | 8 | 8 | 2 | 3 | 128641 | 3175 | 33298 | 174388 |
top | EU-EC-10010985640 | Spontaneous | 2021-11-02 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... | SPIKEVAX [COVID-19 MRNA VACCINE MODERNA (CX-02... | Not reported | <a target="_blank" href="https://dap.ema.europ... |
freq | 1 | 174388 | 3522 | 98584 | 114858 | 174110 | 133179 | 112953 | 174175 | 120757 | 721 | 24051 | 129858 | 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: 174388 entries, 0 to 174387 Data columns (total 14 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 eu_local_number 174388 non-null object 1 report_type 174388 non-null category 2 ev_gateway_receipt_date 174388 non-null datetime64[ns] 3 primary_source_qualification 174388 non-null category 4 primary_source_country_for_regulatory_purposes 174388 non-null object 5 literature_reference 174388 non-null object 6 patient_age_group 174388 non-null category 7 patient_age_group_as_per_reporter 174388 non-null category 8 parent_child_report 174388 non-null category 9 patient_sex 174388 non-null category 10 reaction_list_pt__duration_–_outcome_seriousness_criteria 174388 non-null object 11 suspect/interacting_drug_list__drug_char_indication_pt_action_taken_[_duration_dose_route] 174388 non-null object 12 concomitant/_not_administered_drug_list__drug_char_indication_pt_action_taken_[_duration_dose_route] 174388 non-null object 13 icsr_form 174388 non-null object dtypes: category(6), datetime64[ns](1), object(7) memory usage: 11.6+ 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 | |
---|---|---|---|---|---|---|---|---|---|---|
18269 | EU-EC-10010681141 | Spontaneous | 2021-11-18 | Healthcare Professional | Non European Economic Area | Not available | 0-1 Month | Not Specified | Yes | Male |
45433 | EU-EC-10010269731 | Spontaneous | 2021-10-08 | Healthcare Professional | Non European Economic Area | Not available | 0-1 Month | Not Specified | Yes | Not Specified |
#Total muertes encontradas en el grupo de 0 a 1 mes
len(babys)
2
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
336 | EU-EC-10010992255 | Spontaneous | 2021-12-17 | Non Healthcare Professional | Non European Economic Area | Not available | 2 Months - 2 Years | Not Specified | Yes | Male |
#Total muertes encontradas en el grupo de 2 meses a 2 años
len(nenes)
1
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
6870 | EU-EC-10010889205 | Spontaneous | 2021-12-08 | Healthcare Professional | Non European Economic Area | Not available | 12-17 Years | Not Specified | No | Male |
37821 | EU-EC-10010371169 | Spontaneous | 2021-10-20 | Non Healthcare Professional | Non European Economic Area | Not available | 12-17 Years | Not Specified | No | Male |
40786 | EU-EC-10010338768 | Spontaneous | 2021-10-15 | Non Healthcare Professional | European Economic Area | Not available | 12-17 Years | Not Specified | No | Male |
49614 | EU-EC-10010193681 | Spontaneous | 2021-10-01 | Healthcare Professional | Non European Economic Area | Not available | 12-17 Years | Not Specified | No | Male |
108467 | EU-EC-10009321122 | Spontaneous | 2021-07-09 | Non Healthcare Professional | Non European Economic Area | Not available | 12-17 Years | Not Specified | No | Male |
155533 | EU-EC-10008490019 | Spontaneous | 2021-04-30 | 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)
6
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
165 | EU-EC-10010989592 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Female |
175 | EU-EC-10010989994 | Spontaneous | 2021-12-17 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
330 | EU-EC-10010992211 | Spontaneous | 2021-12-17 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
358 | EU-EC-10010992478 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
399 | EU-EC-10010992989 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Female |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
173468 | EU-EC-10007560641 | Spontaneous | 2021-02-09 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
173474 | EU-EC-10007561974 | Spontaneous | 2021-02-09 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
173483 | EU-EC-10007562600 | Spontaneous | 2021-02-09 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
173487 | EU-EC-10007562787 | Spontaneous | 2021-02-09 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
173554 | EU-EC-10007551029 | Spontaneous | 2021-02-08 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
1223 rows × 10 columns
#Total muertes encontradas en el grupo de 18 a 64 años
len(adultos)
1223
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
65 | EU-EC-10010988013 | Spontaneous | 2021-12-17 | Non Healthcare Professional | European Economic Area | Not available | 65-85 Years | Not Specified | No | Female |
362 | EU-EC-10010992525 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Female |
403 | EU-EC-10010993057 | Spontaneous | 2021-12-17 | Non Healthcare Professional | European Economic Area | Not available | 65-85 Years | Elderly | No | Female |
405 | EU-EC-10010993062 | Spontaneous | 2021-12-17 | Non Healthcare Professional | European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
494 | EU-EC-10010993943 | Spontaneous | 2021-12-17 | Non Healthcare Professional | European Economic Area | Not available | 65-85 Years | Elderly | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
173478 | EU-EC-10007562136 | Spontaneous | 2021-02-09 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
173568 | EU-EC-10007551665 | Spontaneous | 2021-02-08 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Female |
173887 | EU-EC-10007500307 | Spontaneous | 2021-02-02 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
173961 | EU-EC-10007488513 | Spontaneous | 2021-02-01 | Healthcare Professional | Non European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
174235 | EU-EC-10007419556 | Spontaneous | 2021-01-24 | Healthcare Professional | European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
2428 rows × 10 columns
#Total muertes encontradas en el grupo de 65 a 85 años
len(mayores)
2428
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
78 | EU-EC-10010988113 | Spontaneous | 2021-12-17 | Non Healthcare Professional | European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
2235 | EU-EC-10010965148 | Spontaneous | 2021-12-15 | Healthcare Professional | European Economic Area | Not available | More than 85 Years | Elderly | No | Male |
3369 | EU-EC-10010948709 | Spontaneous | 2021-12-14 | Non Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Male |
3405 | EU-EC-10010949421 | Spontaneous | 2021-12-14 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Male |
3498 | EU-EC-10010950874 | Spontaneous | 2021-12-14 | Healthcare Professional | European Economic Area | Not available | More than 85 Years | Elderly | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
173822 | EU-EC-10007488886 | Spontaneous | 2021-02-02 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
174029 | EU-EC-10007471030 | Spontaneous | 2021-01-29 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
174049 | EU-EC-10007450884 | Spontaneous | 2021-01-28 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
174052 | EU-EC-10007450992 | Spontaneous | 2021-01-28 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
174239 | EU-EC-10007416329 | Spontaneous | 2021-01-23 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
1097 rows × 10 columns
#Total muertes encontradas en el grupo de más de 85 años
len(abuelos)
1097
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
1038 | EU-EC-10010978386 | Spontaneous | 2021-12-16 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
7882 | EU-EC-10010882693 | Spontaneous | 2021-12-07 | Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | Yes | Not Specified |
11389 | EU-EC-10010816181 | Spontaneous | 2021-12-01 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
11436 | EU-EC-10010816352 | Spontaneous | 2021-12-01 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
11597 | EU-EC-10010816869 | Spontaneous | 2021-12-01 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
172414 | EU-EC-10007655976 | Spontaneous | 2021-02-18 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Male |
172603 | EU-EC-10007648131 | Spontaneous | 2021-02-17 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Not Specified |
173131 | EU-EC-10007604518 | Spontaneous | 2021-02-12 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Male |
173409 | EU-EC-10007577901 | Spontaneous | 2021-02-10 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
173652 | EU-EC-10007531445 | Spontaneous | 2021-02-05 | Non Healthcare Professional | Non European Economic Area | Not available | Not Specified | Not Specified | No | Female |
133 rows × 10 columns
#Total muertes encontradas en grupo de edad NO ESPECIFICADA
len(no_especificado)
133
#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 | |
---|---|---|---|---|---|---|---|---|---|---|
65 | EU-EC-10010988013 | Spontaneous | 2021-12-17 | Non Healthcare Professional | European Economic Area | Not available | 65-85 Years | Not Specified | No | Female |
78 | EU-EC-10010988113 | Spontaneous | 2021-12-17 | Non Healthcare Professional | European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
165 | EU-EC-10010989592 | Spontaneous | 2021-12-17 | Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Female |
175 | EU-EC-10010989994 | Spontaneous | 2021-12-17 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
330 | EU-EC-10010992211 | Spontaneous | 2021-12-17 | Non Healthcare Professional | Non European Economic Area | Not available | 18-64 Years | Not Specified | No | Male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
174029 | EU-EC-10007471030 | Spontaneous | 2021-01-29 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
174049 | EU-EC-10007450884 | Spontaneous | 2021-01-28 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
174052 | EU-EC-10007450992 | Spontaneous | 2021-01-28 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
174235 | EU-EC-10007419556 | Spontaneous | 2021-01-24 | Healthcare Professional | European Economic Area | Not available | 65-85 Years | Not Specified | No | Male |
174239 | EU-EC-10007416329 | Spontaneous | 2021-01-23 | Healthcare Professional | Non European Economic Area | Not available | More than 85 Years | Not Specified | No | Female |
4890 rows × 10 columns
#Total muertes encontradas TOTALES
len(todos)
4890
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 |
0 | 0-1 Month | 2 |
1 | 12-17 Years | 6 |
7 | Not Specified | 133 |
6 | More than 85 Years | 1097 |
2 | 18-64 Years | 1223 |
5 | 65-85 Years | 2428 |
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 Moderna 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='#2e74b5'
)
)
fig.update_traces(marker_color='#2e74b5',
hovertemplate = 'Muertes: %{y}'+'<br>Rango edad: %{x}')