It is an old dataset and the only shortcoming is that it is less likely to tell us the 2020 or 2021 reality The story here is about how Non-hispanic white have in recent years are increasingly being more impacted by the diseases of heart, while the death rate of the same among the black community has reduced. It would be interesting to find out the reason behind this flip. Like what is being done in the black community to bring down the rate And why the death rate is increasing in non-hispanic white.
import pandas as pd
import altair as alt
= pd.read_csv('New_York_City_Leading_Causes_of_Death.csv')
df 2) df.head(
Year | Leading Cause | Sex | Race Ethnicity | Deaths | Death Rate | Age Adjusted Death Rate | |
---|---|---|---|---|---|---|---|
0 | 2015 | Malignant Neoplasms (Cancer: C00-C97) | Female | Asian and Pacific Islander | 515 | 79.72666911 | 78.86538643 |
1 | 2015 | Diseases of Heart (I00-I09, I11, I13, I20-I51) | Female | Asian and Pacific Islander | 498 | 77.09491499 | 81.60513144 |
df.shape
(1516, 7)
10)).mark_bar().encode(
alt.Chart(df.head(= 'Death Rate:Q',
x = 'Leading Cause:N',
y = 'Race Ethnicity',
tooltip )
#this is what I was hoping for, but it is tiny
10)).mark_point( filled=True,
alt.Chart(df.head(=100).encode(
size= 'Death Rate:Q',
x = 'Race Ethnicity:N',
y = 'Leading Cause',
tooltip )
2) df.head(
Year | Leading Cause | Sex | Race Ethnicity | Deaths | Death Rate | Age Adjusted Death Rate | |
---|---|---|---|---|---|---|---|
0 | 2015 | Malignant Neoplasms (Cancer: C00-C97) | Female | Asian and Pacific Islander | 515 | 79.72666911 | 78.86538643 |
1 | 2015 | Diseases of Heart (I00-I09, I11, I13, I20-I51) | Female | Asian and Pacific Islander | 498 | 77.09491499 | 81.60513144 |
alt.Chart(df).mark_point().encode(= 'Year:N',
x = 'Death Rate:Q',
y = 'Leading Cause',
tooltip = 'Race Ethnicity'
color
)