Data Analysis Fundamentals · Data Foundations and Loading
20 cards
Initial Data Inspection
-
Quick check
A ten-million-row import may carry a malformed header near the start and a totals-like record at the end. Both boundaries must be inspected without rendering the whole table. What fits?
ARender the full table once and scroll to each boundary in turn
Rendering everything is exactly the cost the bounded preview exists to avoid, and it inspects nothing the preview cannot.
BCall `describe()`, which returns both boundary records
`describe()` returns a statistical summary; it does not show individual first or last records.
CCall `head(n)` and `tail(n)` with small explicit counts
Right. The two previews target the first and last observations, and an explicit count keeps the output bounded.
3 / 20
-
Quick check
Which of these appears in the default numeric output of `describe()`?
AThe complete list of the column's values in sorted order
A summary is compact by design; it reports statistics about the values rather than reprinting them.
BThe sample standard deviation of the column
Right. The default numeric summary reports count, mean, sample standard deviation, minimum, the quartiles, and maximum.
CThe memory that the column occupies in the table
Memory use is not part of this statistical summary, which describes distributions rather than storage.
5 / 20
-
Quick check
`describe()` is called on a Series of text status codes. What does the output report?
ANonmissing count, number of unique values, top value and its frequency
Right. The nonnumeric summary covers presence, cardinality, the most frequent value, and how often it occurs.
BMean, variance, skewness and cumulative sum of the codes
Numeric moments cannot be computed from text, and they are not what the nonnumeric summary reports.
CRow labels, column labels, shape and memory footprint
Those are structural attributes of the object rather than a statistical summary of its values.
7 / 20
-
Keep your progress in the app
That’s 3 of 8 quick checks. In the app they stay answered, and every lesson remembers where you left off.
-
Quick check
A mixed table holds numeric amounts and text statuses. The report must summarize both families and state how many observations each figure rests on. Which approach is right?
ACall `describe()` plainly and assume the text statuses appear alongside the amounts
The plain call restricts a mixed table to its numeric columns, so the statuses would be missing from the report.
BCall `head()` and treat the preview as the whole summary
A preview shows a handful of rows; it is not a statistical summary and says nothing about the rest of the table.
CCall `describe(include="all")` and read each count as nonmissing observations
Right. The `all` scope covers both available families, and the count reports nonmissing observations rather than the row total.
10 / 20
-
Quick check
A table must be ordered by `team`, with ties inside each team broken by `score`. Which call expresses that?
A`sort_values(by=["team", "score"])`, keys taken in that order
Right. A list passed to `by` sets the sort keys in sequence, so `score` only settles ties within a team.
B`sort_index(axis=1)`, which orders the labels of both axes at once
That call sorts column labels; it does not order observations by the values in any column.
C`sort_values(by="score")` followed by renaming the index to team
Sorting by score alone loses the grouping by team, and renaming labels does not reorder anything.
13 / 20
-
Quick check
`sort_values()` is called on a column that contains missing values, with no further arguments. Where do the missing rows appear?
AThey keep the position they had before the sort
Every row takes its place in the new order; missing values are positioned rather than left untouched.
BThey are moved after all of the nonmissing values
Right. Missing values are placed last by default, and `na_position="first"` moves them to the front instead.
CThey come back separate from the sorted result
One sorted object comes back; the missing rows sit inside it rather than in a second result.
15 / 20
-
Quick check
A `key` callable is supplied to sort a DataFrame case-insensitively by two text columns. What must the callable return?
AA single scalar holding the value that should sort first
A single scalar cannot order a column, since the sort needs one comparison value per value.
BA Series or array shaped exactly like the column it received
Right. The key runs on each sort column separately and must return an equally shaped Series or array.
CA DataFrame carrying an extra column of comparison values for the sort
The key supplies comparison values for the column it is given; it does not add columns to the table.
18 / 20
-
Quick check
Which statement describes these inspection tools correctly?
A`describe()` covers every column of a mixed table, and `tail()` summarizes distributions
A mixed table defaults to numeric columns only, and `tail()` previews final rows rather than summarizing them.
B`sort_index()` orders rows by their values, and missing values are dropped from the result
`sort_index()` orders by labels, and missing values are placed within the result rather than removed.
C`sort_values()` orders rows by column values, and counts exclude missing data
Right. Value sorting works from the named columns, and each count in a summary reports nonmissing observations.
20 / 20
-
8 quick checks · then the test
In the app, finishing the quick checks opens this lesson’s 10-question test, and the ones you miss come back exactly when you’re about to forget them.
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.