This is my code:
def chickenpox_by_sex():
import pandas as pd
df= pd.read_csv('assets/NISPUF17.csv')
df=df[df['P_NUMVRC']==1]
a=df[df['HAD_CPOX']==1]
b=df[df['HAD_CPOX']==2]
m_flu=len(a[a['SEX']==1])
m_noflu=len(b[b['SEX']==1])
f_flu=len(a[a['SEX']==2])
f_noflu=len(b[b['SEX']==2])
dict={"male":m_flu/m_noflu,"female":f_flu/f_noflu}
print (dict)
chickenpox_by_sex()
And here is the error that I receive:
TypeError Traceback (most recent call last)
<ipython-input-6-3c57eb17d825> in <module>
----> 1 assert len(chickenpox_by_sex())==2, "Return a dictionary with two items, the first for males and the second for females."
2
Can anyone shed some light on the situation?