Prepstellar

Data Analysis Fundamentals · Final test · 25 questions

Data Analysis Fundamentals final test: 25 free questions

Untimed here · timed and scored in the app

A free Data Analysis Fundamentals practice test with 25 questions drawn from the whole course. Answer at your pace and read why each option is right or wrong.

Swipe, scroll or use ← →
  1. Q1 / 25

    How does a DataFrame constructor combine a dictionary of Series with different indexes?

    1. AIt combines values strictly by their current positions
    2. BIt discards every label absent from the first Series
    3. CIt aligns by labels and uses the union of indexes
    4. DIt requires all Series labels to be identical first
    Show the answer

    Dictionary-of-Series construction uses label alignment, retaining the union and marking absent values as missing.

    Next → 1 / 25
  2. Q2 / 25

    Which window family computes over a moving fixed-count or time-offset partition?

    1. AAn exponentially weighted window
    2. BAn expanding window
    3. CA categorical grouping window
    4. DA fixed-count or time-offset rolling window
    Show the answer

    Rolling moves a fixed or variable partition across the values, unlike expanding and exponentially weighted calculations that accumulate history.

    Next → 2 / 25
  3. Q3 / 25

    What does the `keys` argument add to a concatenation result?

    1. AA left-style restriction to the first index
    2. BAn outer MultiIndex level tied to input pieces
    3. CA sequential index that erases input labels
    4. DAn intersection filter for input columns
    Show the answer

    `keys` records which input produced each portion by constructing an additional result-axis level; this contrasts with dropping origin labels.

    Next → 3 / 25
  4. Q4 / 25

    An analyst must compare two regional measures whose row order differs and must retain regions present in just one input. Which model best meets both needs?

    1. AScalar values repeated over the left input positions
    2. BUnlabeled arrays paired by their current row positions
    3. CSeries converted to arrays before their labels are compared
    4. DLabeled Series aligned over the union of region labels
    Show the answer

    Series alignment matches the same region labels despite order and keeps unmatched regions in the union with missing results.

    Next → 4 / 25
  5. Q5 / 25

    Identifiers look like `region-team-member`, but the region and team may themselves contain hyphens. The analyst must isolate only the final member token and retain the unsplit prefix as one field. Which operation meets both constraints?

    1. A`s.str.rsplit("-", n=1, expand=True)`
    2. B`s.str.split("-", n=1, expand=True)`
    3. C`s.str.replace("-", "", regex=False)`
    4. D`s.str.split("-", expand=True)`
    Show the answer

    A one-split `rsplit()` begins at the end, producing the complete prefix and the final member token as two columns.

    Next → 5 / 25
  6. Q6 / 25

    A table has columns `store`, `day`, and `sales`. Each observation is identified by the pair `(store, day)`, and both identifiers must remain available as data columns. Which setup fits?

    1. A`df.set_index(['store', 'day'], drop=False)`
    2. B`df.drop_duplicates(['store', 'day'])`
    3. C`df.reset_index(['store', 'day'], drop=False)`
    4. D`df.set_index('store', drop=True)`
    Show the answer

    A list of two columns creates the composite MultiIndex, and `drop=False` retains those identifiers as columns.

    Next → 6 / 25
  7. Q7 / 25

    How can a Parquet reader avoid materializing unneeded columns?

    1. APass the required names through `columns`
    2. BPass the required names through `partition_cols`
    3. CPass the required names through `compression`
    4. DPass the required names through `index`
    Show the answer

    The read-side `columns` projection selects the fields to materialize; the neighboring arguments concern index writing, compression, or partitioned output.

    Next → 7 / 25
  8. Q8 / 25

    What index condition applies when a rolling window is defined by a time offset?

    1. AThe corresponding time-based index must be monotonic
    2. BThe corresponding time-based index must contain unique days
    3. CThe time-based index must have equal intervals
    4. DThe corresponding time-based index must be categorical
    Show the answer

    Offset-based rolling can handle a variable count of observations, but its time-based index must be monotonic.

    Next → 8 / 25
  9. Q9 / 25

    What does `validate="one_to_one"` check before a merge?

    1. AThat input indexes become result columns
    2. BThat merge keys are unique on both sides
    3. CThat overlapping value columns have suffixes
    4. DThat unmatched keys exist on both sides
    Show the answer

    Cardinality validation checks key uniqueness before merging; one-to-one requires uniqueness in both inputs.

    Next → 9 / 25
  10. Q10 / 25

    Monthly `PeriodIndex` data must become daily-resolution timestamps placed at each span's last representable point. Which conversion expresses both choices?

    1. AUse `to_timestamp('D', how='end')`
    2. BUse `asfreq('D', how='start')` and keep periods
    3. CUse `to_timestamp('D', how='start')`
    4. DUse `to_period('D', how='end')`
    Show the answer

    Timestamp conversion changes spans to points, while the daily frequency and end choice place each point at the period's ending boundary.

    Next → 10 / 25
  11. Halfway, at your pace

    In the app the mock exam is timed and scored like the real thing.

  12. Q11 / 25

    Which representation is a documented candidate for low-cardinality text currently stored as `object`?

    1. AUse `timedelta64[ns]` values
    2. BUse `complex128` numbers
    3. CUse `datetime64[ns]` values
    4. DConvert the column to `category`
    Show the answer

    Categorical data stores repeated labels through unique values and compact integer identifiers; the other dtypes model different data domains.

    Next → 11 / 25
  13. Q12 / 25

    Which selection approaches appear in the beginner pandas workflow?

    1. ASelection by join engine, file writer, and group output
    2. BSelection by plot color, export format, and workbook name
    3. CSelection by package alias, scalar dtype, and chart legend
    4. DSelection by label, by position, and by Boolean condition
    Show the answer

    Pandas introduces label-based, position-based, and Boolean selection as separate ways to narrow data.

    Next → 12 / 25
  14. Q13 / 25

    A financial table must highlight negative cells conditionally and retain that cell styling in an Excel file. The design currently uses external classes attached with `.set_td_classes()`. What change satisfies both requirements?

    1. AMove the negative-value rule into a table-wide hover pseudo-selector
    2. BFormat the values as strings with `.format()` and export the same CSS classes
    3. CKeep `.set_td_classes()` and add the classes through `.set_table_styles()`
    4. DMap the conditional cell properties with `.map()` before Excel export
    Show the answer

    `.map()` evaluates individual values and creates direct cell styles, the documented route that can carry supported properties into Excel.

    Next → 13 / 25
  15. Q14 / 25

    What happens to an input value that is absent from an explicitly declared category set?

    1. AIt is appended to the category set automatically
    2. BIt is preserved as an unordered object value in the same column
    3. CIt replaces first declared category
    4. DIt becomes a missing categorical value
    Show the answer

    Categorical values must belong to the declared set; an out-of-set value is represented as missing.

    Next → 14 / 25
  16. Q15 / 25

    Inside `DataFrame.query()`, an index and a column are both named `a`. What does the expression `a > 2` use?

    1. AThe index named `a`
    2. BThe column named `a`
    3. CBoth objects combined positionally
    4. DNeither object because the name is rejected
    Show the answer

    A column wins a name collision in `query()`; the special identifier `index` remains available for the index.

    Next → 15 / 25
  17. Q16 / 25

    A pipe-delimited file has no header, `NA?` is its sole missing marker, and `account_id` must remain text. Only three named columns are needed. Which ingestion design satisfies all constraints?

    1. ASet `sep="|"`, explicit `names`, `header=None`, `usecols`, text dtype for `account_id`, `na_values=["NA?"]`, and `keep_default_na=False`
    2. BUse `read_json(orient="records")` and treat each pipe-delimited line as a JSON object
    3. CSet `header=0`, keep every column, and rely on the default missing-marker set
    4. DUse default `read_csv()` inference, then rename columns and convert all values to floats
    Show the answer

    The reader settings jointly declare delimiter, absent header, projection, identifier type, and the exact missing-marker policy.

    Next → 16 / 25
  18. Q17 / 25

    What happens if a string passed to `groupby()` matches both a column name and an index-level name?

    1. Apandas raises a `ValueError` because the key is ambiguous
    2. Bpandas groups by the column because columns take precedence
    3. Cpandas combines both matches into a two-key grouping
    4. Dpandas groups by the index because levels take precedence
    Show the answer

    A shared column and index-level name is rejected as ambiguous; the caller must identify an unambiguous grouping source.

    Next → 17 / 25
  19. Q18 / 25

    A Series represents one observation and its index matches the target DataFrame columns. How should it be appended as a row?

    1. AConvert it to a DataFrame and concatenate without transposing
    2. BConvert it to a DataFrame, transpose it, then concatenate
    3. CDiscard its index and use the values as provenance keys
    4. DConcatenate it directly with `axis=1` and preserve labels
    Show the answer

    A row Series must become a one-row DataFrame; transposition makes its index labels become the columns used for alignment.

    Next → 18 / 25
  20. Q19 / 25

    How should a datetime-like Series named `events` expose its hour values without scalar iteration?

    1. AUse `events.hour.dt`
    2. BUse `events.dt.hour`
    3. CUse `events.astype('object').hour`
    4. DUse `events.index.hour`
    Show the answer

    The `.dt` namespace vectorizes datetime-like properties over Series values and keeps the Series index.

    Next → 19 / 25
  21. Q20 / 25

    Which pandas operation is associated with the documented thread-safety concern?

    1. AComparing one local Series with a scalar
    2. BCopying DataFrames shared among threads
    3. CChecking one local DataFrame with `empty`
    4. DReducing one local Boolean Series with `any()`
    Show the answer

    The known thread-safety issue is focused on `copy()` for shared DataFrames; local Boolean questions are unrelated.

    Next → 20 / 25
  22. Q21 / 25

    Which pairing correctly matches a workflow need to a pandas capability?

    1. AChange table layout with read_csv(); change time frequency with concat()
    2. BChange table layout with plot(); change time frequency with Index
    3. CChange table layout with isna(); change time frequency with columns
    4. DChange table layout with reshaping; change time frequency with resampling
    Show the answer

    Reshaping reorganizes a table, while resampling addresses time-series frequency conversion.

    Next → 21 / 25
  23. Q22 / 25

    Which pandas plotting arguments map two named DataFrame columns to the horizontal and vertical axes?

    1. APass the column names through `layout` and `subplots`
    2. BPass columns through `xerr` and `yerr`
    3. CPass the column names through `style` and `label`
    4. DPass the column names through `x` and `y`
    Show the answer

    The `x` and `y` parameters choose the DataFrame columns whose values define the two axes.

    Next → 22 / 25
  24. Q23 / 25

    A transformation is already expressible as an array operation. Which implementation best matches the documented decision rule?

    1. AUse `select_dtypes()` as the computation instead of applying an operation
    2. BUse the direct vectorized expression because it clearly expresses the operation
    3. CConvert labels to rows and invoke `reindex()` for each value
    4. DWrap every scalar in `DataFrame.map()` before trying the array operation
    Show the answer

    A direct vectorized expression is preferred when it communicates the transformation; elementwise `map()` is the fallback for a scalar-only callable.

    Next → 23 / 25
  25. Q24 / 25

    Why is `df['foo'].replace(1, 5, inplace=True)` unsafe under Copy-on-Write?

    1. AIt invokes an inplace method on an intermediate selected column
    2. B`replace()` can operate only on whole DataFrames
    3. CThe column selector automatically removes `foo` from `df`
    4. DCopy-on-Write forbids replacing numeric values
    Show the answer

    The selected Series is an intermediate object, so its inplace update cannot propagate back to the parent; use a parent mapping or assign a non-inplace result.

    Next → 24 / 25
  26. Q25 / 25

    What is the difference between `engine="pyarrow"` and `dtype_backend="pyarrow"` on a supported reader?

    1. AThe engine chooses parsing; the dtype backend chooses Arrow-backed result types
    2. BThe engine writes Parquet; the dtype backend writes JSON records
    3. CThe engine selects SQL queries; the dtype backend selects database tables
    4. DThe engine chooses returned row and column labels; the dtype backend chooses which source rows are read
    Show the answer

    Parsing implementation and returned array representation are independent controls in the documented reader integration.

    Next → 25 / 25
  27. That’s the whole mock exam

    Every question you miss comes back exactly when you’re about to forget it.

How to use this mock exam

Sit all 25 questions in one go: the mix covers every domain in the same proportion as the exam, so a low score points at the domain you skipped rather than at bad luck.

Read the explanation under every question, including the ones you got right — the reason an option is wrong is usually the thing being tested.

Then retake it in the app, where the mock exam is timed and scored and the questions you miss come back on a schedule.

The whole course, on your phone

Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.