Recall & Review
beginner
What is a pandas Series?
A pandas Series is like a single column of data with labels (called an index). It can hold numbers, words, or other data types.
Click to reveal answer
beginner
How do you create a Series from a list in pandas?
Use
pd.Series(your_list). The list values become the data, and pandas automatically creates index numbers starting at 0.Click to reveal answer
beginner
How does pandas create a Series from a dictionary?
When you pass a dictionary to
pd.Series(), the dictionary keys become the index labels, and the values become the data.Click to reveal answer
intermediate
Can you assign custom index labels when creating a Series from a list?
Yes! Use the
index parameter like pd.Series(data, index=[labels]) to set your own labels instead of default numbers.Click to reveal answer
intermediate
What happens if you create a Series from a dict but specify an index with labels not in the dict?
Pandas will create entries for those labels with
NaN (missing) values because the dict has no data for them.Click to reveal answer
What does
pd.Series([10, 20, 30]) produce?✗ Incorrect
Passing a list creates a Series with the list values as data and default numeric index starting at 0.
If you create a Series from a dict
{'a': 1, 'b': 2}, what will be the index?✗ Incorrect
The dict keys become the Series index labels.
How can you create a Series from a list with custom labels 'x', 'y', 'z'?
✗ Incorrect
Use the index parameter to assign custom labels.
What value does pandas assign if an index label is not found in the dictionary when creating a Series?
✗ Incorrect
Pandas uses NaN to represent missing data.
Which of these is a valid way to create a Series from a dictionary?
✗ Incorrect
Passing a dictionary directly to pd.Series creates a Series with keys as index and values as data.
Explain how to create a pandas Series from a list and how to add custom index labels.
Think about the parameters of pd.Series()
You got /4 concepts.
Describe what happens when you create a Series from a dictionary and specify an index with labels not in the dictionary.
Consider how pandas handles missing data
You got /4 concepts.