PythonFan.org
Toggle Menu
Home
Online Python Compiler
Tutorials
Python FastAPI
Python Pandas
Python PyTorch
Python Seaborn
Blog
All Posts
Pandas Data Transformation
Quiz on filtering,grouping,merging,and reshaping data.
1. Which Pandas function is primarily used to merge two DataFrames based on common columns?
merge
concat
join
groupby
2. Select all functions used for reshaping DataFrames in Pandas.
pivot
melt
stack
unstack
groupby
3. The dropna() method removes rows containing missing values by default.
True
False
4. What is the Pandas function used to concatenate multiple DataFrames? (full name)
5. Which method is used to replace specific values in a DataFrame?
replace
apply
map
transform
6. Which functions reshape a DataFrame from long format to wide format?
pivot
pivot_table
melt
stack
7. The applymap() method applies a function element-wise to a DataFrame.
True
False
8. What method is used to split a string column into multiple columns? (format: str.method)
9. What does df.groupby('category').transform('mean') return?
A Series with group means
A DataFrame with the same shape as df, filled with group means
A scalar value
A GroupBy object
10. Which parameters are valid in the pd.merge() function?
on
how
left_on
right_on
axis
11. pd.concat() concatenates DataFrames along rows (axis=0) by default.
True
False
12. Name the method used to fill missing values in a DataFrame with a specific value.
13. Which function stacks column headers into the index, creating a multi-index?
stack
unstack
melt
pivot
14. Select all functions that return a DataFrame when applied to a DataFrame.
merge
concat
groupby
apply
transform
15. The 'how' parameter in pd.merge() specifies the type of join (e.g., 'inner', 'outer').
True
False
Reset
Answered 0 of 0 — 0 correct