Data Analysis Fundamentals · Final test · 25 questions
Data Analysis Fundamentals final test: 25 free questions
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.
-
Q1 / 25
How does a DataFrame constructor combine a dictionary of Series with different indexes?
- AIt combines values strictly by their current positions
- BIt discards every label absent from the first Series
- CIt aligns by labels and uses the union of indexes
- 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 -
Q2 / 25
Which window family computes over a moving fixed-count or time-offset partition?
- AAn exponentially weighted window
- BAn expanding window
- CA categorical grouping window
- 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 -
Q3 / 25
Several DataFrames are stacked by rows. What does the `keys` argument add to the result?
- AA sequential index that erases input labels
- BA left-style restriction to the first index
- CAn intersection filter for input columns
- DAn outer MultiIndex level tied to input pieces
Show the answer
Stacking frames by rows, `keys` records which input produced each portion by adding a level to the result axis. Placing Series side by side with `axis=1` it names the columns instead, so read the rule with its case.
Next → 3 / 25 -
Q4 / 25
Monthly `PeriodIndex` data must become daily-resolution timestamps placed at each span's last representable point. Which conversion expresses both choices?
- AUse `to_timestamp('D', how='end')`
- BUse `asfreq('D', how='start')` and keep periods
- CUse `to_timestamp('D', how='start')`
- 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 → 4 / 25 -
Q5 / 25
Which representation is a documented candidate for low-cardinality text currently stored as `object`?
- AUse `timedelta64[ns]` values
- BUse `complex128` numbers
- CUse `datetime64[ns]` values
- 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 → 5 / 25 -
Q6 / 25
A financial table uses CSS classes to give negative cells a red background, and that supported cell property must survive Excel export. What should change?
- AReturn `background-color: red` directly from `.map()` before `.to_excel()`
- BKeep `.set_td_classes()` and add the classes through `.set_table_styles()`
- CMove the negative-value rule into a table-wide hover pseudo-selector
- DFormat the values as strings with `.format()` and export the same CSS classes
Show the answer
`.map()` creates direct cell styles, and background color is among the supported properties for Excel export.
Next → 6 / 25 -
Q7 / 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?
- A`s.str.rsplit("-", n=1, expand=True)`
- B`s.str.split("-", n=1, expand=True)`
- C`s.str.replace("-", "", regex=False)`
- 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 → 7 / 25 -
Q8 / 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?
- A`df.set_index(['store', 'day'], drop=False)`
- B`df.drop_duplicates(['store', 'day'])`
- C`df.reset_index(['store', 'day'], drop=False)`
- 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 → 8 / 25 -
Q9 / 25
How can a Parquet reader avoid materializing unneeded columns?
- APass the required names through `columns`
- BPass the required names through `partition_cols`
- CPass the required names through `compression`
- 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 → 9 / 25 -
Q10 / 25
What index condition applies when a rolling window is defined by a time offset?
- AThe corresponding time-based index must be monotonic
- BThe corresponding time-based index must contain unique days
- CThe time-based index must have equal intervals
- 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 → 10 / 25 -
Halfway, at your pace
In the app the mock exam is timed and scored like the real thing.
Opens in your browser. Nothing to install.
Start studying -
Q11 / 25
What does `validate="one_to_one"` check before a merge?
- AThat input indexes become result columns
- BThat merge keys are unique on both sides
- CThat overlapping value columns have suffixes
- 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 → 11 / 25 -
Q12 / 25
How should a datetime-like Series named `events` expose its hour values without scalar iteration?
- AUse `events.hour.dt`
- BUse `events.dt.hour`
- CUse `events.astype('object').hour`
- DUse `events.index.hour`
Show the answer
The `.dt` namespace vectorizes datetime-like properties over Series values and keeps the Series index.
Next → 12 / 25 -
Q13 / 25
Which pandas operation is associated with the documented thread-safety concern?
- AComparing one local Series with a scalar
- BCopying DataFrames shared among threads
- CChecking one local DataFrame with `empty`
- 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 → 13 / 25 -
Q14 / 25
Which pandas plotting arguments map two named DataFrame columns to the horizontal and vertical axes?
- APass the column names through `layout` and `subplots`
- BPass columns through `xerr` and `yerr`
- CPass the column names through `style` and `label`
- 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 → 14 / 25 -
Q15 / 25
What happens to an input value that is absent from an explicitly declared category set?
- AIt is appended to the category set automatically
- BIt is preserved as an unordered object value in the same column
- CIt replaces first declared category
- 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 → 15 / 25 -
Q16 / 25
Inside `DataFrame.query()`, an index and a column are both named `a`. What does the expression `a > 2` use?
- AThe index named `a`
- BThe column named `a`
- CBoth objects combined positionally
- 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 → 16 / 25 -
Q17 / 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?
- ASet `sep="|"`, explicit `names`, `header=None`, `usecols`, text dtype for `account_id`, `na_values=["NA?"]`, and `keep_default_na=False`
- BUse `read_json(orient="records")` and treat each pipe-delimited line as a JSON object
- CSet `header=0`, keep every column, and rely on the default missing-marker set
- 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 → 17 / 25 -
Q18 / 25
What happens if a string passed to `groupby()` matches both a column name and an index-level name?
- Apandas raises a `ValueError` because the key is ambiguous
- Bpandas groups by the column because columns take precedence
- Cpandas combines both matches into a two-key grouping
- 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 → 18 / 25 -
Q19 / 25
A Series represents one observation and its index matches the target DataFrame columns. How should it be appended as a row?
- AConvert it to a DataFrame and concatenate without transposing
- BConvert it to a DataFrame, transpose it, then concatenate
- CDiscard its index and use the values as provenance keys
- 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 → 19 / 25 -
Q20 / 25
How should numeric values measured in seconds be parsed as elapsed times?
- AUse `pd.to_timedelta(values)` with no unit
- BConvert the numbers to strings, then use `pd.to_timedelta(values, unit='s')`
- CUse `pd.to_timedelta(values, unit='s')`
- DUse `pd.to_timedelta(values, unit='D')`
Show the answer
For numeric duration input, the unit argument defines the elapsed-time magnitude represented by each number.
Next → 20 / 25 -
Q21 / 25
A nonempty nullable `amount` column must pass only when every value is present and greater than zero. Which condition fits?
- A`df["amount"].gt(0).all(skipna=False)`
- B`df["amount"].gt(0).all()`
- C`df["amount"].gt(0).any()`
- D`(df["amount"].notna() & df["amount"].gt(0)).all()`
Show the answer
The combined mask makes presence and positivity explicit before reducing every row to one Boolean.
Next → 21 / 25 -
Q22 / 25
What is the main analytical benefit of formatting values through Styler?
- AIt recalculates the DataFrame whenever the style renders
- BIt replaces underlying values with formatted strings
- CIt converts every DataFrame into a JSON representation
- DIt changes displayed strings while preserving underlying values
Show the answer
Styler separates presentation from the values that remain available for indexing and calculations.
Next → 22 / 25 -
Q23 / 25
`price` and `units` are numeric columns of `df`. Which expression calculates each row's total with direct vectorized arithmetic?
- A`df.apply(lambda row: row["price"] * row["units"], axis=1)`
- B`pd.Series([p * u for p, u in zip(df["price"], df["units"])])`
- C`df["price"] * df["units"].sum()`
- D`df["price"] * df["units"]`
Show the answer
Multiplying the two columns is the array operation itself: pandas applies it to the whole column at once, and the labels come along. Reach for a callable only when the calculation cannot be written that way.
Next → 23 / 25 -
Q24 / 25
Why is `df['foo'].replace(1, 5, inplace=True)` unsafe under Copy-on-Write?
- AIt invokes an inplace method on an intermediate selected column
- B`replace()` can operate only on whole DataFrames
- CThe column selector automatically removes `foo` from `df`
- 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 -
Q25 / 25
What is the difference between `engine="pyarrow"` and `dtype_backend="pyarrow"` on a supported reader?
- AThe engine chooses parsing; the dtype backend chooses Arrow-backed result types
- BThe engine writes Parquet; the dtype backend writes JSON records
- CThe engine selects SQL queries; the dtype backend selects database tables
- 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 -
That’s the whole mock exam
Every question you miss comes back exactly when you’re about to forget it.
Back to the courseOpens in your browser. Nothing to install.
Start studying
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 computer and your phone
Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.
Opens in your browser. Nothing to install.
Start studying“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”
