DAP391m - FPTU_AI Questions &
Answers
Matplotlib was created by John Hunter, an American neurobiologist, and was originally
developed as an EEG/ECoG visualization tool.
A: True.
B: False. - answer True.
Using the notebook backend, you can modify a figure after it is rendered.
A: True.
B: False. - answer True.
%matplotlib inline is an example of Matplotlib magic functions.
A: True.
B: False. - answer True.
Area plots are stacked by default.
A: True
B: False - answer True
Given a pandas series, series_data, which of the following will create a histogram of
series_data and align the bin edges with the horizontal tick marks?
A: count, bin_edges = np.histogram(series_data)
series_data.plot(kind='hist', xticks = count)
count, bin_edges = np.histogram(series_data)
series_data.plot(kind='hist', xticks = count)
B: series_data.plot(kind='hist')
series_data.plot(kind='hist')
C: count, bin_edges = np.histogram(series_data)
series_data.plot(kind='hist', xticks = count, bin_edges)
count, bin_edges = np.histogram(series_data)
series_data.plot(kind='hist', xticks = count, bin_edges)
D: series_data.plot(kind='hist', xticks = bin_edges)
count, bin_edges = np.histogram(series_data)
series_data.plot(kind='hist', xticks = bin_edges)
count, bin_edges = np.histogram(series_data)
E: series_data.plot(type='hist', xticks = bin_edges)
count, bin_edges = np.histogram(series_data)
series_data.plot(type='hist', - answer series_data.plot(kind='hist', xticks = bin_edges)
count, bin_edges = np.histogram(series_data)
,The following code will create a horizontal bar chart of the data in a pandas dataframe,
question.
question.plot(kind='barh')
A: True.
B: False. - answer True.
What do the letters in the box plot above represent?
A: A = Median, B = Third Quartile, C = First Quartile, D = Inter Quartile Range, E =
Minimum, and F = Outliers
B: A = Mean, B = Upper Mean Quartile, C = Lower Mean Quartile, D = Inter Quartile
Range, E = Minimum, and F = Outliers
C: A = Median, B = Third Quartile, C = Mean, D = Inter Quartile Range, E = Lower
Quartile, and F = Outliers
D: A = Mean, B = Third Quartile, C = First Quartile, D = Inter Quartile Range, E =
Minimum, and F = Maximum
E: A = Mean, B = Third Quartile, C = First Quartile, D = Inter Quartile Range, E =
Minimum, and F = Outliers - answer A = Median, B = Third Quartile, C = First
Quartile, D = Inter Quartile Range, E = Minimum, and F = Outliers
What is the correct combination of function and parameter to create a box plot in
Matplotlib?
A: Function = plot, and Parameter = kind with value = "box"
B: Function = plot, and Parameter = kind with value = "boxplot"
C: Function = box, and Parameter = type with value = "plot"
D: Function = plot, and Parameter = type with value = "box"
E: Function = boxplot, and Parameter = type with value = "plot" - answer Function =
plot, and Parameter = kind with value = "box"
Which of the lines of code below will create the following scatter plot, given the pandas
dataframe, df_total?
A: import matplotlib.pyplot as plt
plot(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')
import matplotlib.pyplot as plt
plot(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')
B: import matplotlib.scripting.pyplot as plt
df_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 plt
, df_total.plot(kind='scatter', x='year', y='total')
plt.title('Total Immigrant population to Canada from 1980 - 2013')
plt.label('Year')
plt.l - answer import matplotlib.pyplot as plt
df_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')
Seaborn is a Python visualization library that provides a high-level interface for
visualizing geospatial data.
A: True.
B: False. - answer False.
Which of the choices below will create the following regression line plot, given a pandas
dataframe, data_df?
A: data_df.plot(kind="regression", color="green", marker="+")
B: data_df.plot(kind="regplot", color="green", marker="+")
C: import seaborn as sns
ax = sns.regplot(x="year", y="total", data=data_df, color="green")
D: import seaborn as sns
ax = sns.regplot(x="total", y="year", data=data_df, color="green")
E: import seaborn as sns
ax = sns.regplot(x="year", y="total", data=data_df, color="green", marker="+") - answer
import seaborn as sns
ax = sns.regplot(x="year", y="total", data=data_df, color="green", marker="+")
The easiest way to create a waffle chart in Python is using the Python package,
PyWaffle.
A: True.
B: False. - answer True.
You cluster markers, superimposed onto a map in Folium, using a feature group object.
A: False
B: True - answer False
The following code will generate a map of Spain, displaying its hill shading and natural
vegetation.
folium.Map(location=[-40.4637, -3.7492], zoom_start=6, tiles='Stamen Toner')
A: True.
B: False. - answer False.
A choropleth map is a thematic map in which areas are shaded or patterned in
proportion to the measurement of the statistical variable being displayed on the map.
A: True.
B: False. - answer True.