I have an error when I run the following codes for the question. Question: Let's explore the relationship between being fed breastmilk as a child and getting a seasonal influenza vaccine from a healthcare provider. Return a tuple of the average number of influenza vaccines for those children we know received breastmilk as a child and those who know did not.
This function should return a tuple in the form (use the correct numbers):
(2.5, 0.1)
codes:
def average_influenza_doses():
# YOUR CODE HERE
# raise NotImplementedError()
import pandas as pd
import numpy as np
df = pd.read_csv("assests/NISPUF17.csv", index_col=0)
cbf_flu=df.loc[:,['CBF_01','P_NUMFLU']]
cbf_flu1=cbf_flu[cbf_flu['CBF_01'] ==1].dropna()
cbf_flu2=cbf_flu[cbf_flu['CBF_01'] ==2].dropna()
flu1=cbf_flu1['P_NUMFLU'].values.copy()
flu1[np.isnan(flu1)] = 0
f1=np.sum(flu1)/len(flu1)
flu2=cbf_flu2['P_NUMFLU'].values.copy()
flu2[np.isnan(flu2)] = 0
f2=np.sum(flu2)/len(flu2)
aid =(f1,f2)
return aid
assert len(average_influenza_doses())==2
, "Return two values in a tuple, the first for yes and the second for no."