CHAPTER 10
Beginner
Pandas Series and DataFrames
Updated: May 18, 2026
5 min read
# CHAPTER 10
Pandas Series and DataFrames
1. Chapter Introduction
Series and DataFrame are Pandas' two pillars. This chapter explores every creation method, attribute, and access pattern — the foundation for all Pandas operations.2. Series — Deep Dive
python
3. DataFrame — Creation Methods
python
4. DataFrame Attributes
python
5. Column Operations
python
6. Index Operations
python
7. Common Mistakes
-
df.valuesvsdf.tonumpy(): Both return NumPy arrays, buttonumpy()is preferred as it handles dtypes and missing values more explicitly.
-
df.columnsis immutable: You cannot dodf.columns[0] = 'new'— usedf.rename()instead.
8. MCQs
Question 1
pd.Series({'a': 1, 'b': 2}) creates Series with?
Question 2
df.size returns?
Question 3
df.values returns?
Question 4
df.setindex('Name') does?
Question 5
Add column df['Tax'] = df['Salary'] * 0.2 creates?
Question 6
df.rename(columns={'old': 'new'}) does?
Question 7
pd.cut(df['Age'], bins=[0,18,65,100], labels=['child','adult','senior']) creates?
Question 8
df.memoryusage(deep=True) returns?
Question 9
df.reset_index() does?
Question 10
df.ndim for a DataFrame returns?
9. Interview Questions
- Q: How do you create a DataFrame from a list of dictionaries?
-
Q: What is the difference between
df.indexanddf.columns?