Free Practice Quiz Question List

2 Working with Data and Data Types Online Quiz Questions

Use this free practice quiz with 20 questions to review 2 Working with Data and Data Types, test your knowledge, and prepare for your next test or exam.

20 questions
01
Choose one
1 point

A researcher stores one sample per row, with columns for sample ID, temperature, and collection date. Which description best fits this pandas DataFrame?

  1. A

    Rows are variables and columns are observations; all columns must have the same data type.

  2. B

    Rows are observations and columns are variables; different columns can have different data types.

  3. C

    Rows are data types and columns are observations; each row can have a different structure.

  4. D

    Rows and columns both represent observations; each DataFrame stores only one data type.

02
True or false
1 point

A missing measurement is equivalent to zero even when the dataset does not define it that way. True or false?

  1. A

    True

  2. B

    False

03
Written response
1 point

Which pandas function loads a CSV file into a DataFrame?

04
Fill in the blank
1 point

In a typical tabular dataset, rows represent and columns represent .

05
Choose one
1 point

A customer ID column contains only digits. Which interpretation is usually most appropriate when deciding how to analyze the column?

  1. A

    Treat the codes as measurements and calculate their average.

  2. B

    Convert the codes to temperatures because both contain digits.

  3. C

    Treat the codes as identifiers rather than quantities.

  4. D

    Treat the codes as dates because they label customer records.

06
Choose all
1 point

You want to review the distribution of locations while keeping missing entries visible, and also find the missing-value count for each column. Which two pandas expressions are suited to those tasks?

  1. A

    Use measurements["location"].value_counts(dropna=False) to review location counts while keeping missing values visible.

  2. B

    Use measurements.shape to count missing values separately in every column.

  3. C

    Use measurements.isna().sum() to count missing values per column.

  4. D

    Use measurements.head() to standardize inconsistent category capitalization automatically.

07
Fill in the blank
1 point

A numeric-looking column may be imported as if it contains symbols or inconsistent entries.

08
True or false
1 point

When importing a CSV, the word “unknown” should be added to na_values only if it represents missing data under that dataset’s conventions.

  1. A

    True

  2. B

    False

09
Written response
1 point

What pandas object behaves like a labeled one-dimensional column of a DataFrame?

10
Choose one
1 point

A date column has been imported as text. What is the most careful next step before converting it to a date-time type?

  1. A

    Convert every value immediately and discard any entry that fails.

  2. B

    Check the format and decide how to handle entries that do not convert.

  3. C

    Assume that every value containing digits is already stored as a number.

  4. D

    Replace all nonnumeric values with zero before checking the column.

11
Choose all
1 point

A location column appears complete, but some entries may use inconsistent capitalization or spacing. Which two checks are useful for investigating data quality?

  1. A

    Review the column’s distinct values for differences such as North and NORTH.

  2. B

    Compare values with the data dictionary, expected units, and plausible ranges.

  3. C

    Rely only on the count of missing values to detect all inconsistent entries.

  4. D

    Automatically change every unusual number without investigating it.

12
Open ended
1 point

A height column contains some values that are much larger than the others, and you suspect that centimeters and inches may have been mixed. Describe how you would investigate and clean the data without risking valid information.

13
Choose one
1 point

A dataset uses low, medium, and high to describe rating levels. Which interpretation best accounts for the values’ limited set and their order?

  1. A

    Store the ratings as dates because they have a meaningful sequence.

  2. B

    Treat the ratings as numeric measurements because the categories are ordered.

  3. C

    Treat the ratings as categorical values, recognizing that plain text does not express their order.

  4. D

    Treat the ratings as identifiers because they distinguish one response from another.

14
Choose one
1 point

A dataset has several labeled columns, and each column contains values for one variable. Which pandas structure best represents the dataset as a whole?

  1. A

    A Series, because it contains multiple labeled columns

  2. B

    A DataFrame, because it is a two-dimensional table with labeled columns

  3. C

    A categorical value, because the table has labels

  4. D

    A Boolean, because each row is one observation

15
Choose one
1 point

A customer ID column contains only digits. Which approach best reflects what those values mean when choosing how to analyze the column?

  1. A

    Treat it as a quantity and calculate its mean

  2. B

    Treat it as a measurement because it contains digits

  3. C

    Treat it as an identifier rather than a quantity

  4. D

    Treat it as a date because it identifies a customer

16
Choose one
1 point

A CSV file contains the text “unknown” in a column. Before using na_values=["unknown"] when importing the file, what should you do?

  1. A

    Check whether “unknown” is a missing-value marker in this dataset before passing it to na_values

  2. B

    Always include “unknown” in na_values because it is never a meaningful category

  3. C

    Convert every text value in the file to a missing value

  4. D

    Use head() to tell pandas that “unknown” means missing

17
Choose one
1 point

A date column is imported as text, and some entries may use inconsistent formats. What is the most reliable next step before converting the column to a date-time type?

  1. A

    Convert it immediately and discard any entries that cause errors

  2. B

    Keep it as text permanently because dates cannot be analyzed chronologically

  3. C

    Replace every value that does not look like a date with zero

  4. D

    Check the format and plan how to handle entries that do not convert

18
True or false
1 point

In pandas, use isna() or notna() to detect missing values rather than comparing values directly with NaN. True or false?

  1. A

    True

  2. B

    False

19
Written response
1 point

Which pandas DataFrame attribute reports the stored data type of each column?

20
Written response
1 point

A rating variable uses the limited set of values “low,” “medium,” and “high.” What general data type is suited to representing these group values?