Screen Link:
https://app.dataquest.io/c/95/m/520/line-graphs-and-time-series/7/types-of-growth
My Code:
**VERSION 1 EXTERNAL CALL CHAIN**
def plot_list(country_names):
for country in country_names:
plot_cumulative_cases(country)
def plot_cumulative_cases(country_name):
cntry = who_time_series[who_time_series['Country'] == country_name]
plt.plot(cntry['Date_reported'], cntry['Cumulative_cases'])
plt.title('{}: Cumulative Reported Cases'.format(country_name))
plt.xlabel('Date')
plt.ylabel('Number of Cases')
plt.show()
plot_list(['Brazil','Iceland','Argentina'])
brazil = 'exponential'
argentina = 'exponential'
iceland = 'logarithmic'
**VERSION 2 FUNCTION DEFINITION**
def plot_cumulative_cases(country_name):
for country in country_name:
cntry = who_time_series[who_time_series['Country'] == country]
plt.plot(cntry['Date_reported'], cntry['Cumulative_cases'])
plt.title('{}: Cumulative Reported Cases'.format(country))
plt.xlabel('Date')
plt.ylabel('Number of Cases')
plt.show()
plot_cumulative_cases(['Brazil','Iceland','Argentina'])
#plt.plot(who_time_series[who_time_series['Country']=='India']['Date_reported'],who_time_series[who_time_series['Country']=='India']['Cumulative_cases'])
brazil = 'exponential'
argentina = 'exponential'
iceland = 'logarithmic'
What I expected to happen:
Work fine as it is just a same function being called exactly same number of times for each country
What actually happened:
error :
One of your variables doesn't seem to have the correct value. Please re-check the instructions and your code.
Your 1st plot doesn't match what we expected.
(actually none do)
Screenshots for reference (both versions same error) (re-pasted with better screenshot)