Pandas Mastery Quiz

10:00

File I/O, time series, reshaping and performance techniques in pandas. · 10 questions

Question 1 of 10
Which argument makes `pd.read_csv` interpret 05/04/2025 as 5 April 2025?
Question 2 of 10
What does `pd.read_excel('file.xlsx', sheet_name=None)` return?
Question 3 of 10
Which method converts a wide table (one column per month) into long format?
Question 4 of 10
Which dtype is best for a column with only 5 distinct payment modes repeated across millions of rows?
Question 5 of 10
What does this code return?
s = df.set_index("date")["amount"]
s.resample("ME").sum()
Question 6 of 10
`df.pivot(index='branch', columns='month', values='sales')` raises `ValueError: Index contains duplicate entries`. What is the fix?
Question 7 of 10
Why does `df.to_csv('out.csv')` often produce an `Unnamed: 0` column when read back?
Question 8 of 10
Which is the fastest way to create a column that is `amount * 0.1` for members and 0 otherwise?
Question 9 of 10
What does this produce?
g = df.groupby(["branch", "category"])["amount"].sum()
t = g.unstack("category", fill_value=0)
Question 10 of 10
Which statement about `df[df['city'] == 'Pune']['amount'] = 0` is correct?