1. Home
  2. Explore
  3. Computer Science
  4. Python Data Analysis

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Python Data Analysis

  • 72Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Python Setup

Which alias is conventionally used when importing pandas in the tutorial?

72 questions

  1. 1

    Which alias is conventionally used when importing pandas in the tutorial?

    1. A

      The alias plt is used for pandas

    2. B

      The alias np is used for pandas

    3. C

      The alias pd is used for pandas

    4. D

      The alias sns is used for pandas

    Correct answer
    C

    The alias pd is used for pandas

    Explanation

    Pandas is imported with the alias pd, allowing commands such as pd.read_csv() and pd.set_option().

  2. 2

    Which alias is used for NumPy in the tutorial?

    1. A

      The alias sns is used for NumPy

    2. B

      The alias np is used for NumPy

    3. C

      The alias pd is used for NumPy

    4. D

      The alias plt is used for NumPy

    Correct answer
    B

    The alias np is used for NumPy

    Explanation

    NumPy is imported as np.

  3. 3

    Which library is imported as plt for plotting?

    1. A

      Seaborn is imported as plt

    2. B

      Pandas is imported as plt

    3. C

      Matplotlib is imported as plt

    4. D

      NumPy is imported as plt

    Correct answer
    C

    Matplotlib is imported as plt

    Explanation

    The tutorial imports matplotlib.pyplot as plt for visualization.

  4. 4

    What is Seaborn especially useful for in this workflow?

    1. A

      Converting dates into integers

    2. B

      Resetting row indexes after filtering

    3. C

      Reading comma-separated files

    4. D

      Creating exploratory plots with data

    Correct answer
    D

    Creating exploratory plots with data

    Explanation

    Seaborn is introduced as a visualization library that is especially helpful for exploratory plots.

  5. 5

    What effect does plt.style.use('ggplot') have?

    1. A

      It removes missing values from every plotted column

    2. B

      It changes the visual style of Matplotlib and Seaborn plots

    3. C

      It converts all columns into numeric values

    4. D

      It limits plots to exactly ten observations

    Correct answer
    B

    It changes the visual style of Matplotlib and Seaborn plots

    Explanation

    The style sheet changes the appearance of Matplotlib and Seaborn plots.

  6. 6

    What does pd.set_option('display.max_columns', 200) accomplish?

    1. A

      It adds 200 columns filled with missing values

    2. B

      It selects the 200 most important columns

    3. C

      It allows up to 200 columns to be displayed

    4. D

      It limits the data frame to 200 columns

    Correct answer
    C

    It allows up to 200 columns to be displayed

    Explanation

    This display option changes how many columns pandas shows, without changing the data frame itself.

  7. 7

    What is a Kaggle notebook primarily described as?

    1. A

      A package that replaces Python and pandas

    2. B

      A database that automatically cleans every uploaded data set

    3. C

      An environment for running code and writing plain-text descriptions

    4. D

      A spreadsheet that cannot execute programming code

    Correct answer
    C

    An environment for running code and writing plain-text descriptions

    Explanation

    A Kaggle notebook is described as an environment similar to a Jupyter notebook where code and explanatory text can be written and executed.

  8. 8

    Which function is used to load the roller-coaster CSV file into a data frame?

    1. A

      The function pd.reset_index() is used

    2. B

      The function pd.value_counts() is used

    3. C

      The function pd.duplicated() is used

    4. D

      The function pd.read_csv() is used

    Correct answer
    D

    The function pd.read_csv() is used

    Explanation

    The data is loaded with pandas' read_csv() function and assigned to df.

  9. 9

    What does df.shape reveal about a data frame?

    1. A

      It reports the average of every numeric column

    2. B

      It reports the number of duplicate values only

    3. C

      It reports the number of rows and columns

    4. D

      It reports the data type of every column

    Correct answer
    C

    It reports the number of rows and columns

    Explanation

    The shape describes the data frame dimensions: rows followed by columns.

  10. 10

    What dimensions did the initially loaded roller-coaster data set have?

    1. A

      It had 187 rows and 56 columns

    2. B

      It had 1087 rows and 13 columns

    3. C

      It had 990 rows and 13 columns

    4. D

      It had 56 rows and 187 columns

    Correct answer
    A

    It had 187 rows and 56 columns

    Explanation

    The initially loaded data set was described as having 187 rows and 56 columns.

  11. 11

    What does df.head() display by default?

    1. A

      The five columns with the most missing values

    2. B

      The last five rows of the data frame

    3. C

      The five most common values in each column

    4. D

      The first five rows of the data frame

    Correct answer
    D

    The first five rows of the data frame

    Explanation

    The head() method displays the first five rows unless another number is specified.

  12. 12

    How can a user display the first 20 rows instead of the default five?

    1. A

      By calling df.shape(20)

    2. B

      By calling df.columns(20)

    3. C

      By calling df.head(20)

    4. D

      By calling df.describe(20)

    Correct answer
    C

    By calling df.head(20)

    Explanation

    An integer argument passed to head() specifies how many initial rows to display.

  13. 13

    Why might dots appear between columns when displaying a data frame?

    1. A

      Pandas hides some columns by default when many columns exist

    2. B

      The omitted columns were automatically deleted from the data

    3. C

      The omitted columns contain invalid Python syntax

    4. D

      The omitted columns contain only duplicate rows

    Correct answer
    A

    Pandas hides some columns by default when many columns exist

    Explanation

    Pandas abbreviates wide displays by hiding some columns, which produces dots in the output.

  14. 14

    What does df.columns provide?

    1. A

      A count of missing values in each column

    2. B

      A listing of all column names

    3. C

      A summary of numeric statistics

    4. D

      A list of rows containing duplicates

    Correct answer
    B

    A listing of all column names

    Explanation

    The columns attribute lists the names of the data frame's columns.

  15. 15

    What does df.dtypes show?

    1. A

      The average value calculated for each column

    2. B

      The order in which columns were created

    3. C

      The number of unique values in each column

    4. D

      The pandas data type assigned to each column

    Correct answer
    D

    The pandas data type assigned to each column

    Explanation

    Each data-frame column is a pandas Series with a data type, which df.dtypes displays.

  16. 16

    How are columns with the pandas object type characterized in this data set?

    1. A

      They generally contain string-like values

    2. B

      They always contain Boolean values

    3. C

      They always contain floating-point values

    4. D

      They contain only date-time values

    Correct answer
    A

    They generally contain string-like values

    Explanation

    The tutorial identifies the object columns as generally representing strings.

  17. 17

    What kind of information does df.describe() summarize by default?

    1. A

      Only the names of object columns

    2. B

      The complete text of every string column

    3. C

      Only rows containing missing values

    4. D

      Statistics for numeric data

    Correct answer
    D

    Statistics for numeric data

    Explanation

    The describe() function provides summary statistics for numeric columns by default.

  18. 18

    Which statistic from df.describe() indicates how many nonmissing observations a numeric column has?

    1. A

      The standard deviation statistic

    2. B

      The minimum statistic

    3. C

      The count statistic

    4. D

      The mean statistic

    Correct answer
    C

    The count statistic

    Explanation

    The count reports the number of available values used for the numeric summary.

  19. 19

    Why should unwanted columns or rows be removed before extensive cleaning?

    1. A

      It guarantees that every remaining value is correct

    2. B

      It prevents time being spent cleaning data that will not be used

    3. C

      It automatically removes every duplicate observation

    4. D

      It converts all remaining strings into dates

    Correct answer
    B

    It prevents time being spent cleaning data that will not be used

    Explanation

    The tutorial recommends removing irrelevant data first so cleaning effort is focused on the retained subset.

  20. 20

    Why were numeric versions of some roller-coaster features created?

    1. A

      They replace every missing value with the column mean

    2. B

      They convert categorical features into row indexes

    3. C

      They remove text such as units and store comparable numeric values

    4. D

      They preserve units as text while deleting all numbers

    Correct answer
    C

    They remove text such as units and store comparable numeric values

    Explanation

    Numeric versions of speed and similar fields strip text such as units and provide values in a common unit.

  21. 21

    How can several desired columns be selected from a pandas data frame?

    1. A

      By passing a plot type into the dtypes method

    2. B

      By passing a row number inside the shape method

    3. C

      By passing a list of column names inside double brackets

    4. D

      By passing a statistic name into the columns attribute

    Correct answer
    C

    By passing a list of column names inside double brackets

    Explanation

    Using double brackets with a list of names subsets a data frame to those columns.

  22. 22

    What is the purpose of the drop() method when removing a column?

    1. A

      It converts a specified column into a numeric series

    2. B

      It counts how often values occur in a specified column

    3. C

      It displays the first values from a specified column

    4. D

      It removes a specified column from the data frame

    Correct answer
    D

    It removes a specified column from the data frame

    Explanation

    The drop() method can remove one column or a list of columns.

  23. 23

    Why is axis=1 used when dropping a column with drop()?

    1. A

      It tells pandas to keep only the first column

    2. B

      It tells pandas to operate on columns rather than rows

    3. C

      It tells pandas to calculate one statistic per column

    4. D

      It tells pandas to sort columns in descending order

    Correct answer
    B

    It tells pandas to operate on columns rather than rows

    Explanation

    In this context, axis=1 identifies the column axis; rows use axis=0.

  24. 24

    What is the purpose of assigning a selected subset back to df?

    1. A

      It makes the reduced set of columns the working data frame

    2. B

      It changes every value in the data frame to a string

    3. C

      It sorts the data frame by its first column

    4. D

      It restores all columns that were previously removed

    Correct answer
    A

    It makes the reduced set of columns the working data frame

    Explanation

    Reassignment makes the selected subset the version of df used in later analysis.

  25. 25

    Why is .copy() added after subsetting the data frame?

    1. A

      It automatically copies every missing value into the subset

    2. B

      It converts the subset into a visualization object

    3. C

      It duplicates every row so the sample size increases

    4. D

      It creates an independent data frame rather than a reference

    Correct answer
    D

    It creates an independent data frame rather than a reference

    Explanation

    Using .copy() helps ensure the result is a new data frame and not merely a reference to the original.

  26. 26

    What was the shape after selecting the desired columns but before removing duplicate rows?

    1. A

      It had 187 rows and 56 columns

    2. B

      It had 1087 rows and 56 columns

    3. C

      It had 990 rows and 13 columns

    4. D

      It had 1087 rows and 13 columns

    Correct answer
    D

    It had 1087 rows and 13 columns

    Explanation

    After column selection, the data frame retained 1087 rows and was reduced to 13 columns.

  27. 27

    Which function converts a column such as Opening Date into a date-time type?

    1. A

      The function pd.to_datetime() is used

    2. B

      The function df.value_counts() is used

    3. C

      The function pd.to_numeric() is used

    4. D

      The function df.reset_index() is used

    Correct answer
    A

    The function pd.to_datetime() is used

    Explanation

    The tutorial uses pd.to_datetime() to force the opening-date column into a date-time type.

  28. 28

    What does pd.to_numeric() attempt to do?

    1. A

      It converts values into a numeric column when possible

    2. B

      It converts values into categorical labels when possible

    3. C

      It converts values into row indexes when possible

    4. D

      It converts values into a date-time column when possible

    Correct answer
    A

    It converts values into a numeric column when possible

    Explanation

    The function attempts to make a column numeric, such as converting a numeric-looking string column.

  29. 29

    How are column names renamed in pandas using df.rename()?

    1. A

      A dictionary maps each old name to its new name

    2. B

      A row index maps each old name to a position

    3. C

      A plot maps each old name to a color

    4. D

      A statistic maps each old name to its average

    Correct answer
    A

    A dictionary maps each old name to its new name

    Explanation

    The columns argument receives a dictionary of old-name and new-name pairs.

  30. 30

    Why can consistent capitalization and avoiding spaces improve column names?

    1. A

      They cause pandas to infer every column as numeric

    2. B

      They make column references more consistent and convenient

    3. C

      They prevent a data frame from having more than ten columns

    4. D

      They guarantee that missing values are removed

    Correct answer
    B

    They make column references more consistent and convenient

    Explanation

    Consistent names, especially names without spaces, make later references easier to read and use.

  31. 31

    Which expression identifies missing values throughout a data frame?

    1. A

      The expression df.isna() identifies missing values

    2. B

      The expression df.columns() identifies missing values

    3. C

      The expression df.shape() identifies missing values

    4. D

      The expression df.head() identifies missing values

    Correct answer
    A

    The expression df.isna() identifies missing values

    Explanation

    The isna() method returns Boolean indicators for missing or null values.

  32. 32

    Why is df.isna().sum() more useful than viewing df.isna() alone for a broad missingness check?

    1. A

      It displays only columns that contain no missing values

    2. B

      It summarizes the number of missing values in each column

    3. C

      It replaces every missing value with zero

    4. D

      It removes every row containing a missing value

    Correct answer
    B

    It summarizes the number of missing values in each column

    Explanation

    Summing the Boolean missingness indicators provides a count of null values per column.

  33. 33

    What does duplicated() return by default for duplicate rows?

    1. A

      It deletes all duplicate rows immediately

    2. B

      It marks only the first occurrence as a duplicate

    3. C

      It marks every row as a duplicate, including unique rows

    4. D

      It marks later occurrences as duplicates and leaves the first unmarked

    Correct answer
    D

    It marks later occurrences as duplicates and leaves the first unmarked

    Explanation

    By default, the first occurrence is retained and subsequent identical rows are marked True.

  34. 34

    How can duplicate observations be inspected after identifying them?

    1. A

      By using .shape with the duplicate column name

    2. B

      By using .loc with the Boolean duplicate mask

    3. C

      By using .rename() with the duplicate Boolean values

    4. D

      By using .describe() with the duplicate row number

    Correct answer
    B

    By using .loc with the Boolean duplicate mask

    Explanation

    Applying .loc with the Boolean mask selects the rows identified as duplicates.

  35. 35

    What happened when duplicates were checked using only Coaster Name?

    1. A

      Exactly thirteen rows were removed from the data frame

    2. B

      Ninety-seven later rows shared a coaster name with an earlier row

    3. C

      Every row had a unique coaster name and location

    4. D

      No rows shared a coaster name with an earlier row

    Correct answer
    B

    Ninety-seven later rows shared a coaster name with an earlier row

    Explanation

    The tutorial found 97 duplicated rows when checking only the coaster-name field.

  36. 36

    Why might two records have the same coaster name but different years?

    1. A

      The name field automatically changes when a date is missing

    2. B

      A coaster might have been introduced, removed, and reintroduced

    3. C

      A duplicate name proves that both records are data-entry errors

    4. D

      Pandas always assigns a random year to duplicate rows

    Correct answer
    B

    A coaster might have been introduced, removed, and reintroduced

    Explanation

    The tutorial suggests that a coaster could have been put online, taken offline, and later put back online.

  37. 37

    Which columns were used together to define the duplicates that should be removed?

    1. A

      Latitude, longitude, and year introduced

    2. B

      Coaster name, location, and opening date

    3. C

      Speed, height, and material type

    4. D

      Status, manufacturer, and height restriction

    Correct answer
    B

    Coaster name, location, and opening date

    Explanation

    Duplicates were identified using the combination of coaster name, location, and opening date.

  38. 38

    What does applying ~ to a duplicate mask accomplish?

    1. A

      It selects only rows marked as duplicates

    2. B

      It selects rows that are not marked as duplicates

    3. C

      It reverses the order of duplicate rows

    4. D

      It converts duplicate values into missing values

    Correct answer
    B

    It selects rows that are not marked as duplicates

    Explanation

    The tilde negates the Boolean mask, so nonduplicate rows, including the first occurrence, are selected.

  39. 39

    Why is reset_index(drop=True) useful after removing rows?

    1. A

      It converts the index values into dates

    2. B

      It creates a consecutive index without retaining the old index as a column

    3. C

      It removes every column whose name contains the word index

    4. D

      It restores rows that were removed as duplicates

    Correct answer
    B

    It creates a consecutive index without retaining the old index as a column

    Explanation

    Filtering can leave gaps in the index; reset_index(drop=True) creates a new consecutive index without adding the old one as a column.

  40. 40

    What was the final cleaned data set described in the tutorial?

    1. A

      It contained 990 unique roller coasters and 56 feature columns

    2. B

      It contained 1087 unique roller coasters and 56 feature columns

    3. C

      It contained 187 unique roller coasters and 13 feature columns

    4. D

      It contained 990 unique roller coasters and 13 feature columns

    Correct answer
    D

    It contained 990 unique roller coasters and 13 feature columns

    Explanation

    After removing the selected duplicates, the data set had 990 unique roller coasters and 13 feature columns.

  41. 41

    What is univariate analysis?

    1. A

      Grouping observations by two categorical variables

    2. B

      Analyzing one feature at a time

    3. C

      Comparing every feature with every other feature

    4. D

      Removing duplicate rows from several data frames

    Correct answer
    B

    Analyzing one feature at a time

    Explanation

    Univariate analysis examines an individual feature's distribution, values, and potential outliers.

  42. 42

    What does value_counts() show for a single categorical or discrete-valued series?

    1. A

      The number of columns displayed in a notebook

    2. B

      The correlation between every pair of columns

    3. C

      The date type assigned to every row

    4. D

      The frequency of each unique value

    Correct answer
    D

    The frequency of each unique value

    Explanation

    The method counts how often each unique value occurs and orders the results from most to least common by default.

  43. 43

    What did applying value_counts() to Year Introduced reveal?

    1. A

      The years with the greatest and fewest numbers of introduced coasters

    2. B

      The exact correlation between height and speed

    3. C

      The number of missing coordinates in every row

    4. D

      The average speed for every location

    Correct answer
    A

    The years with the greatest and fewest numbers of introduced coasters

    Explanation

    Counting the years shows which introduction years occur most and least often.

  44. 44

    Why might head(10) be applied after value_counts() before plotting?

    1. A

      To calculate statistics for exactly ten columns

    2. B

      To convert ten values into date-time objects

    3. C

      To remove ten duplicate rows from the data

    4. D

      To plot only the ten most frequent values

    Correct answer
    D

    To plot only the ten most frequent values

    Explanation

    Because value_counts() is ordered by frequency, head(10) selects the ten most common values for a less crowded plot.

  45. 45

    What does a bar plot of the counted introduction years display?

    1. A

      Each column's data type and memory usage

    2. B

      Each coaster's speed and height as a paired point

    3. C

      Each year and the number of coasters introduced in that year

    4. D

      Each missing value and its replacement

    Correct answer
    C

    Each year and the number of coasters introduced in that year

    Explanation

    The bar plot represents years on one axis and their counts on the other.

  46. 46

    What is the purpose of adding a plot title and axis labels?

    1. A

      They convert the plot into a data frame

    2. B

      They change the underlying values being plotted

    3. C

      They clarify what the plotted values and axes represent

    4. D

      They remove outliers from the plotted data

    Correct answer
    C

    They clarify what the plotted values and axes represent

    Explanation

    Titles and labels improve interpretation by identifying the subject and meaning of each axis.

  47. 47

    Why is a histogram appropriate for roller-coaster speed?

    1. A

      It displays the names of all unique categorical values

    2. B

      It compares two variables using one point per observation

    3. C

      It shows the counts of a continuous variable within bins

    4. D

      It shows exact correlations among all numeric features

    Correct answer
    C

    It shows the counts of a continuous variable within bins

    Explanation

    A histogram groups continuous values into intervals, or bins, and displays the count in each interval.

  48. 48

    What is the effect of changing the number of histogram bins?

    1. A

      It changes the column from numeric to categorical

    2. B

      It changes every speed value into a different unit

    3. C

      It removes all observations outside the central range

    4. D

      It changes the granularity used to display the distribution

    Correct answer
    D

    It changes the granularity used to display the distribution

    Explanation

    More or fewer bins provide different levels of detail about the same distribution.

  49. 49

    What does a kernel density estimate plot provide?

    1. A

      A list of all duplicate rows in the data frame

    2. B

      A table of the original values in sorted order

    3. C

      A smoothed, normalized view of a variable's distribution

    4. D

      A direct calculation of the mean for every group

    Correct answer
    C

    A smoothed, normalized view of a variable's distribution

    Explanation

    A KDE plot provides a smoothed distribution and is often less cluttered when comparing multiple distributions.

  50. 50

    What pattern was observed in the roller-coaster speed distribution?

    1. A

      The distribution contained no values near 35 or 50 miles per hour

    2. B

      Only one speed occurred because all coasters had identical designs

    3. C

      All speeds were evenly distributed across the entire range

    4. D

      Common concentrations appeared around roughly 35 and 50 miles per hour

    Correct answer
    D

    Common concentrations appeared around roughly 35 and 50 miles per hour

    Explanation

    The KDE discussion noted noticeable humps near approximately 35 and 50 miles per hour.

  51. 51

    What is the main purpose of a scatter plot in this analysis?

    1. A

      To list the names of every column in a data frame

    2. B

      To identify the data type of one selected series

    3. C

      To count the frequency of one categorical feature

    4. D

      To examine the relationship between two numeric features

    Correct answer
    D

    To examine the relationship between two numeric features

    Explanation

    A scatter plot places paired observations for two variables on an x-y coordinate system.

  52. 52

    In the basic scatter plot, which variables were placed on the axes?

    1. A

      Year introduced on xxx and material type on yyy

    2. B

      Height in feet on xxx and location on yyy

    3. C

      Speed in miles per hour on xxx and height in feet on yyy

    4. D

      Location on xxx and status on yyy

    Correct answer
    C

    Speed in miles per hour on xxx and height in feet on yyy

    Explanation

    The example plotted speed in miles per hour against height in feet.

  53. 53

    What does each point in that scatter plot represent?

    1. A

      One observation or roller-coaster row

    2. B

      One missing value in the data set

    3. C

      One column in the data frame

    4. D

      One unique data type in pandas

    Correct answer
    A

    One observation or roller-coaster row

    Explanation

    Each dot corresponds to an observation in the data frame.

  54. 54

    What is the purpose of plt.show() after creating a pandas plot?

    1. A

      It saves the plot permanently as a CSV file

    2. B

      It changes the plot from a scatter plot to a histogram

    3. C

      It displays the plot cleanly without printing the object representation

    4. D

      It removes all null values before rendering the plot

    Correct answer
    C

    It displays the plot cleanly without printing the object representation

    Explanation

    Calling plt.show() produces a cleaner display instead of showing the Matplotlib object representation.

  55. 55

    What additional capability does Seaborn provide in the scatter-plot example?

    1. A

      It changes all numeric columns into strings

    2. B

      It automatically deletes every point with a missing value

    3. C

      It limits the scatter plot to one observation per category

    4. D

      It can color points according to another variable using hue

    Correct answer
    D

    It can color points according to another variable using hue

    Explanation

    The hue parameter assigns colors based on a third variable, such as year introduced.

  56. 56

    What does a Seaborn pair plot display?

    1. A

      Only the ten largest values in one selected series

    2. B

      Pairwise relationships and individual feature distributions

    3. C

      The exact Python code used to load the data

    4. D

      Only the missing values for every categorical column

    Correct answer
    B

    Pairwise relationships and individual feature distributions

    Explanation

    A pair plot presents scatter plots for feature pairs and distributions along the diagonal.

  57. 57

    What appears along the diagonal of a typical pair plot?

    1. A

      The average of each feature grouped by location

    2. B

      The distribution of each individual feature

    3. C

      The duplicate rows for each feature

    4. D

      The column names in alphabetical order only

    Correct answer
    B

    The distribution of each individual feature

    Explanation

    The diagonal shows each feature compared with itself, commonly as its distribution.

  58. 58

    How can a pair plot use color to add another dimension of information?

    1. A

      By supplying a categorical feature such as material type as hue

    2. B

      By setting the number of histogram bins equal to the row count

    3. C

      By using reset_index() to color each row sequentially

    4. D

      By replacing every numeric feature with its column index

    Correct answer
    A

    By supplying a categorical feature such as material type as hue

    Explanation

    The material type was used as hue, allowing point colors to represent categories such as wood or steel.

  59. 59

    What does a correlation value describe between two numeric features?

    1. A

      The strength and direction of their linear association

    2. B

      The number of missing values in their column names

    3. C

      The number of duplicate rows shared by the features

    4. D

      The order in which the features were imported

    Correct answer
    A

    The strength and direction of their linear association

    Explanation

    Correlation summarizes the strength and direction of association between numeric variables.

  60. 60

    What relationship was reported between coaster speed and height?

    1. A

      They had a correlation of approximately 0.730.730.73

    2. B

      They had a correlation of exactly 000

    3. C

      They had a correlation of exactly 111

    4. D

      They had a correlation of approximately −0.73-0.73−0.73

    Correct answer
    A

    They had a correlation of approximately 0.730.730.73

    Explanation

    The tutorial reported a speed-height correlation of about 0.730.730.73, indicating a fairly strong positive association.

  61. 61

    Why should null values be removed before calculating the correlation matrix in the example?

    1. A

      The correlation function only accepts columns with text values

    2. B

      Removing nulls changes all categorical values into numbers

    3. C

      The calculation is performed on complete numeric observations

    4. D

      Null removal guarantees that every correlation equals zero

    Correct answer
    C

    The calculation is performed on complete numeric observations

    Explanation

    The example selects numeric features, drops null rows, and then calculates correlations on the remaining complete observations.

  62. 62

    What does a correlation heat map add to a correlation data frame?

    1. A

      A method for selecting the first ten rows of each feature

    2. B

      A replacement for date-time conversion

    3. C

      A list of all locations with missing coordinates

    4. D

      A visual representation of correlation strengths among features

    Correct answer
    D

    A visual representation of correlation strengths among features

    Explanation

    A heat map uses color to make the pattern of correlations easier to inspect visually.

  63. 63

    Why are the diagonal values of a correlation matrix equal to 111?

    1. A

      Each feature has exactly one missing value

    2. B

      The diagonal contains the number of rows in the data frame

    3. C

      The diagonal contains the default histogram bin count

    4. D

      Each feature is perfectly correlated with itself

    Correct answer
    D

    Each feature is perfectly correlated with itself

    Explanation

    A variable has a perfect positive correlation with itself, so diagonal entries equal 111.

  64. 64

    What question was used to demonstrate a complete exploratory analysis task?

    1. A

      Which materials occur in precisely thirteen columns?

    2. B

      Which locations have the fastest coasters with at least ten coasters?

    3. C

      Which manufacturers have exactly ten missing latitude values?

    4. D

      Which years contain the greatest number of duplicate rows?

    Correct answer
    B

    Which locations have the fastest coasters with at least ten coasters?

    Explanation

    The final analysis asks which locations have the highest average coaster speeds while meeting a minimum of ten coasters.

  65. 65

    Why was the location value Other excluded from the final location analysis?

    1. A

      It is the location with the highest average speed

    2. B

      It identifies rows that are already sorted correctly

    3. C

      It does not represent a specific actual location

    4. D

      It contains only numeric values rather than text

    Correct answer
    C

    It does not represent a specific actual location

    Explanation

    The tutorial treats Other as a non-specific category rather than a true location and filters it out.

  66. 66

    What does grouping by location allow the analyst to do?

    1. A

      Convert every location into a unique row index

    2. B

      Compare only the first ten rows of the data set

    3. C

      Remove all speed values from the data frame

    4. D

      Calculate statistics separately for each location

    Correct answer
    D

    Calculate statistics separately for each location

    Explanation

    Grouping creates location-specific subsets on which aggregate statistics can be calculated.

  67. 67

    What two aggregates were calculated for speed within each location?

    1. A

      The minimum height and the maximum year

    2. B

      The mean speed and the number of coaster observations

    3. C

      The median latitude and the mode of material

    4. D

      The number of columns and the number of data types

    Correct answer
    B

    The mean speed and the number of coaster observations

    Explanation

    The grouped analysis calculates the mean speed and the count of coasters for each location.

  68. 68

    Why was a count threshold applied after grouping by location?

    1. A

      To retain only locations with at least ten coasters

    2. B

      To retain only locations with exactly ten columns

    3. C

      To remove locations whose average speed was positive

    4. D

      To ensure every location had the same number of rows

    Correct answer
    A

    To retain only locations with at least ten coasters

    Explanation

    The analysis filters grouped results to locations whose coaster count is greater than or equal to ten.

  69. 69

    Which grouped statistic was used to rank locations by coaster speed?

    1. A

      The maximum number of missing values

    2. B

      The first coaster's opening date

    3. C

      The count of columns for each location

    4. D

      The mean speed for each location

    Correct answer
    D

    The mean speed for each location

    Explanation

    Locations were sorted using the mean speed calculated for their coasters.

  70. 70

    What type of plot was chosen to display the final location comparison?

    1. A

      A heat map of all string-valued columns

    2. B

      A scatter plot of latitude against longitude

    3. C

      A horizontal bar plot of average coaster speed

    4. D

      A histogram of every individual opening date

    Correct answer
    C

    A horizontal bar plot of average coaster speed

    Explanation

    A horizontal bar plot was used to compare average coaster speed across qualifying locations.

  71. 71

    Which location was reported as having the highest average coaster speed under the ten-coaster condition?

    1. A

      Busch Gardens was reported as having the highest average

    2. B

      Every location was reported as having the same average

    3. C

      Cedar Point was reported as having the highest average

    4. D

      The Other category was reported as having the highest average

    Correct answer
    A

    Busch Gardens was reported as having the highest average

    Explanation

    The final plot showed Busch Gardens first, followed by Cedar Point and other qualifying locations.

  72. 72

    Why does explicitly asking a data question help an analyst learn pandas?

    1. A

      It forces the analyst to identify and connect the operations needed for an answer

    2. B

      It eliminates the need to understand the data types in the data frame

    3. C

      It guarantees that pandas will generate the final answer automatically

    4. D

      It makes exploratory plots unnecessary

    Correct answer
    A

    It forces the analyst to identify and connect the operations needed for an answer

    Explanation

    A concrete question motivates the analyst to search for and combine filtering, grouping, aggregation, sorting, and plotting operations.

Question 1 of 72
Question 1 of 72

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent