Docsity

Python Data Visualization Certificate Practice Exam, Exams of Technology

Toggle sidebar
bg1
Applied Plotting Charting and Data
Representation in Python Certificate Practice
Exam
**Question 1.** Which visualization principle emphasizes that the amount of ink used to
represent data should be maximized relative to decorative ink?
A) Chart Junk
B) Data‑Ink Ratio
C) Lie Factor
D) Small Multiples
Answer: B
Explanation: Edward Tufte’s Data‑Ink Ratio advocates using as much ink as possible to display
data itself while minimizing non‑data ink such as gridlines or ornamental elements.
**Question 2.** A chart that uses a truncated y‑axis to exaggerate differences between values
suffers from which of the following?
A) Small Multiples
B) Lie Factor
C) Sparklines
D) Data‑Ink Ratio
Answer: B
Explanation: Truncating an axis creates a misleading visual proportion, inflating the perceived
change – a classic example of a high Lie Factor.
**Question 3.** Which visual encoding is most appropriate for representing a nominal
(categorical) variable?
A) Position on a common scale
B) Length of a bar
C) Hue (color) without ordering
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d

Partial preview of the text

Download Python Data Visualization Certificate Practice Exam and more Exams Technology in PDF only on Docsity!

Representation in Python Certificate Practice

Exam

Question 1. Which visualization principle emphasizes that the amount of ink used to represent data should be maximized relative to decorative ink? A) Chart Junk B) Data‑Ink Ratio C) Lie Factor D) Small Multiples Answer: B Explanation: Edward Tufte’s Data‑Ink Ratio advocates using as much ink as possible to display data itself while minimizing non‑data ink such as gridlines or ornamental elements. Question 2. A chart that uses a truncated y‑axis to exaggerate differences between values suffers from which of the following? A) Small Multiples B) Lie Factor C) Sparklines D) Data‑Ink Ratio Answer: B Explanation: Truncating an axis creates a misleading visual proportion, inflating the perceived change – a classic example of a high Lie Factor. Question 3. Which visual encoding is most appropriate for representing a nominal (categorical) variable? A) Position on a common scale B) Length of a bar C) Hue (color) without ordering

Representation in Python Certificate Practice

Exam

D) Angle of a pie slice Answer: C Explanation: Nominal data have no inherent order; using hue (different colors) without implying ranking is ideal. Question 4. When comparing the distribution of a single numeric variable across multiple categories, which chart type is most effective? A) Stacked bar chart B) Violin plot C) Scatter plot D) Area chart Answer: B Explanation: Violin plots display the full probability density for each category, allowing easy comparison of shape, spread, and multimodality. Question 5. In Matplotlib’s object‑oriented API, which method creates a new set of sub‑plots and returns a Figure and an array of Axes objects? A) plt.subplot() B) plt.subplots() C) fig.add_axes() D) plt.figure() Answer: B Explanation: plt.subplots() generates a Figure and a grid of Axes, facilitating multi‑plot layouts. Question 6. Which of the following statements about the plt.plot() function is FALSE?

Representation in Python Certificate Practice

Exam

Explanation: sns.lmplot() fits and displays a regression model, automatically adding a shaded confidence interval. Question 9. When visualizing a large scatter plot with millions of points, which technique helps prevent overplotting? A) Increase marker size B) Use a logarithmic y‑axis C) Apply alpha blending (transparency) D) Convert to a line plot Answer: C Explanation: Alpha blending makes overlapping points semi‑transparent, revealing dense regions without hiding points. Question 10. In a heatmap created with Matplotlib’s imshow(), which argument controls the mapping from data values to colors? A) cmap B) norm C) extent D) interpolation Answer: A Explanation: The cmap argument selects a colormap that translates numeric values into colors. Question 11. Which chart type is best suited for visualizing the change in a single metric over time while emphasizing the area under the curve? A) Bar chart

Representation in Python Certificate Practice

Exam

B) Area chart C) Box plot D) Pie chart Answer: B Explanation: Area charts fill the space beneath a line, highlighting cumulative totals or trends over time. Question 12. In Pandas, calling df.plot(kind='hist') is equivalent to which Matplotlib function? A) plt.plot() B) plt.bar() C) plt.hist() D) plt.boxplot() Answer: C Explanation: The Pandas histogram plot internally invokes Matplotlib’s plt.hist(). Question 13. Which of the following is a perceptual limitation that can affect color‑based encoding? A) People cannot distinguish more than ~7 hue variations reliably. B) Length perception is less accurate than angle perception. C) Humans are better at comparing areas than positions. D) Color saturation is interpreted as a quantitative scale. Answer: A Explanation: Human color perception is limited; distinguishing many similar hues becomes difficult, especially for color‑blind viewers.

Representation in Python Certificate Practice

Exam

Answer: C Explanation: The box spans from the 25th percentile (Q1) to the 75th percentile (Q3), encompassing the IQR. Question 17. Which Seaborn function produces a grid of categorical plots (e.g., box or violin) split by a hue variable? A) sns.pairplot() B) sns.catplot() C) sns.heatmap() D) sns.jointplot() Answer: B Explanation: sns.catplot() can create faceted categorical visualizations with col, row, and hue arguments. Question 18. In Matplotlib, which method adds a text annotation at a specific data coordinate? A) ax.text() B) ax.annotate() C) plt.title() D) plt.legend() Answer: A Explanation: ax.text(x, y, s) places static text at the given data coordinates. Question 19. To plot a time series with dates on the x‑axis using Matplotlib’s pyplot interface, which import is typically required?

Representation in Python Certificate Practice

Exam

A) import datetime as dt B) from matplotlib import dates as mdates C) import pandas as pd D) from matplotlib import ticker as mtick Answer: B Explanation: Matplotlib’s dates module provides locators and formatters for handling date tick marks. Question 20. Which of the following best describes an exploratory visualization? A) A polished chart intended for a publication. B) A static infographic summarizing final results. C) An interactive plot used to discover patterns in raw data. D) A chart with heavy decorative elements. Answer: C Explanation: Exploratory visualizations are used during analysis to uncover insights, often interactive and less formal. Question 21. When using plt.bar() to create a stacked bar chart, which parameter controls the stacking order? A) width B) bottom C) align D) color Answer: B

Representation in Python Certificate Practice

Exam

D) Number of data points to number of pixels. Answer: C Explanation: Lie Factor = (perceived change)/(actual change); values >1 indicate exaggeration. Question 25. Which Matplotlib function would you use to create a violin plot without importing Seaborn? A) plt.violinplot() B) plt.boxplot() C) plt.kdeplot() D) plt.distplot() Answer: A Explanation: Matplotlib includes violinplot() for visualizing kernel density estimations of data. Question 26. Which of the following is NOT a best practice when designing a color map for a heatmap? A) Use a sequential colormap for ordered data. B) Use a diverging colormap when data have a meaningful midpoint. C) Use a rainbow colormap for all cases. D) Ensure the colormap is perceptually uniform. Answer: C Explanation: Rainbow colormaps can mislead perception and are discouraged for most quantitative visualizations. Question 27. In Pandas, which method combines multiple DataFrames vertically while preserving index alignment?

Representation in Python Certificate Practice

Exam

A) df.append() B) pd.concat([df1, df2]) C) df.merge(df2) D) df.join(df2) Answer: B Explanation: pd.concat with axis=0 stacks DataFrames vertically, aligning columns by name. Question 28. Which Matplotlib property controls the thickness of the lines in a plot? A) linewidth B) lineweight C) penwidth D) stroke Answer: A Explanation: The linewidth (or lw) argument sets the line thickness. Question 29. When plotting categorical data with a bar chart, what is the most appropriate way to order the bars? A) Alphabetically by category label. B) Randomly to avoid bias. C) By descending value magnitude. D) By increasing hue intensity. Answer: C Explanation: Ordering bars by value magnitude makes comparisons easier and highlights the highest/lowest categories.

Representation in Python Certificate Practice

Exam

Answer: B Explanation: Pie charts display parts of a whole as angular slices, conveying relative proportions. Question 33. To create a faceted grid of line plots by a categorical variable using Seaborn, which function is ideal? A) sns.relplot(kind='line') B) sns.lineplot() C) sns.catplot(kind='line') D) sns.displot() Answer: A Explanation: sns.relplot with kind='line' supports faceting via col and row arguments. Question 34. In Matplotlib, which argument of plt.errorbar() specifies the vertical error magnitude? A) yerr B) xerr C) errsize D) errorbars Answer: A Explanation: yerr provides the length of vertical error bars. Question 35. Which of the following is a key advantage of using the object‑oriented API over pyplot for complex figures? A) Automatic figure creation. B) Implicit state management.

Representation in Python Certificate Practice

Exam

C) Fine‑grained control over individual Axes objects. D) Simpler syntax for quick plots. Answer: C Explanation: The OO API lets you manipulate each Axes and Figure explicitly, essential for multi‑plot layouts. Question 36. Which of the following best describes “chart junk”? A) Essential gridlines that aid reading. B) Decorative elements that do not convey information. C) Data points plotted with markers. D) Axis labels and titles. Answer: B Explanation: Chart junk refers to unnecessary visual clutter that distracts from the data. Question 37. When visualizing a time series with irregular time intervals, which Matplotlib function helps handle missing dates? A) plt.plot_date() B) plt.step() C) plt.fill_between() D) plt.bar() Answer: A Explanation: plt.plot_date() correctly spaces points according to actual dates, handling gaps. Question 38. Which of the following Seaborn themes provides a dark background with white gridlines?

Representation in Python Certificate Practice

Exam

Explanation: The handles parameter allows you to specify exactly which plotted artists appear in the legend. Question 41. When plotting a large dataset, which Matplotlib backend is most suitable for interactive exploration? A) Agg B) TkAgg C) PDF D) SVG Answer: B Explanation: TkAgg (or other interactive backends like Qt5Agg) enables real‑time zooming and panning. Question 42. Which of the following is a correct way to share the x‑axis among multiple subplots created with plt.subplots()? A) fig, axes = plt.subplots(2,1, sharex=True) B) fig, axes = plt.subplots(2,1, shared_x=True) C) fig, axes = plt.subplots(2,1, linkx=True) D) fig, axes = plt.subplots(2,1, syncx=True) Answer: A Explanation: The sharex argument synchronizes the x‑axis across subplots. Question 43. In Seaborn, which parameter of sns.boxplot() controls whether outliers are shown? A) showfliers

Representation in Python Certificate Practice

Exam

B) outlier_color C) whiskerprops D) notch Answer: A Explanation: Setting showfliers=False hides the individual outlier points. Question 44. Which Matplotlib function adds a color bar to a plot, typically used with imshow or pcolormesh? A) plt.colorbar() B) plt.legend() C) plt.cmap() D) plt.bar() Answer: A Explanation: plt.colorbar() creates a legend for the colormap, indicating the mapping of values to colors. Question 45. The “lie factor” of a chart equals 1 when: A) The visual representation is larger than the data. B) The chart uses 3‑D effects. C) The visual length accurately reflects the data magnitude. D) The chart contains no axis labels. Answer: C Explanation: A Lie Factor of 1 indicates no distortion; visual changes match actual data changes.

Representation in Python Certificate Practice

Exam

Explanation: sns.kdeplot() draws a smoothed density curve representing the probability distribution. Question 49. When using plt.bar() with a categorical x‑axis, which argument determines the width of each bar? A) width B) bar_width C) size D) thickness Answer: A Explanation: The width parameter sets the fraction of the space each bar occupies. Question 50. In a Matplotlib figure, which method removes the top and right spines (borders) for a cleaner look? A) ax.spines['top'].set_visible(False) followed by ax.spines['right'].set_visible(False) B) ax.remove_spines('top','right') C) ax.hide(['top','right']) D) ax.border(False) Answer: A Explanation: Directly setting the visibility of the specified spines hides them. Question 51. Which of the following is a key advantage of using small multiples over a single complex chart? A) Reduces the total number of data points displayed. B) Allows each subplot to have its own scale, aiding comparison.

Representation in Python Certificate Practice

Exam

C) Enables the use of 3‑D effects in each panel. D) Guarantees a lower Lie Factor. Answer: B Explanation: Small multiples let each panel focus on a subset while maintaining consistent visual encoding, making comparison easier. Question 52. In Pandas, which method creates a line plot of each column in a DataFrame, using the index as the x‑axis? A) df.plot.line() B) df.plot(kind='line') C) df.line_plot() D) df.plot_series() Answer: B Explanation: df.plot(kind='line') draws a line for every column, aligning them on the DataFrame index. Question 53. Which Matplotlib function is used to create a polar plot (e.g., radar chart)? A) plt.polar() B) plt.subplot(projection='polar') C) plt.pie() D) plt.scatter(polar=True) Answer: B Explanation: Specifying projection='polar' in subplot creates a polar coordinate axes for radar or wind‑rose plots.