data visualization with python coursera week 2 quiz answers
Basic Visualization Tools
1. Area plots are stacked by default.
- True
- False
2. The following code will create a histogram of a pandas series, series_data, and align the bin edges with the horizontal tick marks.
count, bin_edges = np.histogram(series_data)
series_data.plot(kind='hist', xticks = count, bin_edges)
- True.
- False.
3. The following code will create a horizontal bar chart of the data in a pandas dataframe, question. question.plot(type='bar', rot=90)
- True
- False
Specialized Visualization Tools

4. What do the letters in the box plot above represent?
- A = Mean, B = Third Quartile, C = First Quartile, D = Inter Quartile Range, E = Minimum, and F = Outliers
- A = Mean, B = Upper Mean Quartile, C = Lower Mean Quartile, D = Inter Quartile Range, E = Minimum, and F = Outliers
- A = Median, B = Third Quartile, C = Mean, D = Inter Quartile Range, E = Lower Quartile, and F = Outliers
- A = Mean, B = Third Quartile, C = First Quartile, D = Inter Quartile Range, E = Minimum, and F = Maximum
- A = Median, B = Third Quartile, C = First Quartile, D = Inter Quartile Range, E = Minimum, and F = Outliers
5. What is the correct combination of function and parameter to create a box plot in Matplotlib?
- Function = plot, and Parameter = type with value = โboxโ
- Function = boxplot, and Parameter = type with value = โplotโ
- Function = plot, and Parameter = kind with value = โboxplotโ
- Function = plot, and Parameter = kind with value = โboxโ
- Function = box, and Parameter = type with value = โplotโ
6. Which of the lines of code below will create the following scatter plot, given the pandas dataframe, df_total?

- import matplotlib.pyplot as pltdf_total.plot(kind=โscatterโ, x=โyearโ, y=โtotalโ)plt.title(โTotal Immigrant population to Canada from 1980 โ 2013โ)plt.xlabel (โYearโ)plt.ylabel(โNumber of Immigrantsโ)
- import matplotlib.scripting.pyplot as pltdf_total.plot(kind=โscatterโ, x=โyearโ, y=โtotalโ)plt.title(โTotal Immigrant population to Canada from 1980 โ 2013โ)plt.label(โYearโ)plt.label(โNumber of Immigrantsโ)
- import matplotlib.scripting.pyplot as pltdf_total.plot(type=โscatterโ, y=โyearโ, x=โtotalโ)plt.title(โTotal Immigrant population to Canada from 1980 โ 2013โ)plt.xlabel (โYearโ)plt.ylabel(โNumber of Immigrantsโ)
- import matplotlib.pyplot as pltdf_total.plot(type=โscatterโ, x=โyearโ, y=โtotalโ)plt.title(โTotal Immigrant population to Canada from 1980 โ 2013โ)plt.label (โYearโ)plt.label(โNumber of Immigrantsโ)
- import matplotlib.pyplot as pltplot(kind=โscatterโ, x=โyearโ, y=โtotalโ, data=df_total)plt.title(โTotal Immigrant population to Canada from 1980 โ 2013โ)plt.label (โYearโ)plt.label(โNumber of Immigrantsโ)