Data Analysis Fundamentals · Getting started
22 cards
Pandas for Tabular Analysis
-
Quick check
A dataset has one row per order, four named variables, and a different type in each variable. Which object preserves both the table shape and the variable types?
AA Series, since one labeled dimension holds every named variable at once and keeps each type
A Series has one labeled dimension and one kind of value, so it cannot keep four named variables with separate types.
BA DataFrame, with orders as rows and variables as columns
Right. A DataFrame gives two labeled axes, and its columns may each keep their own data type.
CAn Index built from the observations, the variables, and the values together
An Index supplies the labels of an axis; it is not the store that holds a table's values.
3 / 22
-
Quick check
You have one temperature reading per day for a month and nothing else. Which setup matches that data?
A`import pandas as pd`, then a Series indexed by the day labels
Right. The conventional import binds the short name pd, and one labeled sequence of values is exactly the shape of a Series.
B`import pandas as pd`, then an Index whose entries are the readings themselves
The import line is correct, but an Index carries the axis labels rather than the measured values.
C`load pandas into Index`, then one repeated value standing for the month
That is not a valid import statement, and a single repeated value would erase the day-by-day readings.
6 / 22
-
Quick check
Two analysts describe the same Series. Which description explains what gives one of its values a lasting identity?
AIts place in the printed output, recomputed after every operation you run
Display order changes with sorting and filtering, so it cannot be what identifies a value.
BIts conversion into a plain array, with the labels stripped off first
Removing labels is what takes identity away; it cannot be what supplies it.
CIts label in the Index, which stays attached to the value
Right. The Index label stays attached to its value, and that link is broken only if you change it deliberately.
9 / 22
-
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
Two Series hold the same three regions, but their rows are in different orders. What happens when you add them?
AEach region is added to its own label, whatever the row order
Right. Series arithmetic aligns on the Index, so the row order does not decide which observations meet.
BThe top row of one is added to the top row of the other
That is positional pairing, which is exactly what label alignment avoids.
CPandas refuses the addition until both are sorted the same way
No matching order is required; alignment handles the difference for you.
12 / 22
-
Quick check
You add two Series and the result shows a missing value at the label Mar. What does that tell you?
ABoth inputs held the same observation under that label
Matching values would be added together and produce a number, not a gap.
BOne of the two inputs simply had no value stored at that label
Right. Alignment takes the union of the labels and marks any label that one input lacks.
CThe two indexes were replaced by a plain numbered range
Alignment keeps the labels; it does not renumber them.
15 / 22
-
Quick check
Two regional measures arrive in different row orders, and one region appears in only one of them. You must compare them and keep that gap visible. What do you rely on?
APositional pairing, which lines up the top rows and drops the extra region
Positional pairing ignores the labels, so it can compare the wrong regions and lose the extra one.
BConversion to plain arrays, which keeps the region names attached to the numbers
Plain arrays have no labels, so the region names would be gone before the comparison began.
CLabel alignment over the union of regions, which reports the gap as missing
Right. Alignment matches regions despite the order, and the union keeps the unmatched region with a missing result.
18 / 22
-
Quick check
Which sentence describes what the rest of this course builds on?
AOne command that converts any file directly into a finished report
Pandas is a toolkit of steps, not a single command that produces a finished answer.
BA set of operations over labeled objects, from loading through to exporting
Right. Loading, inspecting, selecting, cleaning, calculating, combining, reshaping, time work, plotting, and exporting all act on labeled objects.
CA drawing library in which labels are decoration rather than structure
Plotting is only one of the operations, and labels carry the structure the other steps depend on.
20 / 22
-
Quick check
Which summary of this lesson is correct?
AA Series has one dimension, a DataFrame has rows and columns, and operations pair values by label
Right. Those are the two shapes and the alignment rule that everything later depends on.
BA Series has two dimensions, a DataFrame has one, and pandas pairs values by row position
The dimensions are the wrong way round, and pairing follows labels rather than positions.
CBoth objects discard their labels before arithmetic, and any unmatched label is dropped
Labels are kept through arithmetic, and unmatched labels stay in the union as missing results.
22 / 22
-
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.