Pandas Quiz

10:00

DataFrames, selection and groupby. · 10 questions

Question 1 of 10
Which method shows the first 5 rows?
Question 2 of 10
Select rows by label with…
Question 3 of 10
How do you count missing values per column?
Question 4 of 10
Which merges two DataFrames on a key?
Question 5 of 10
What does `df.groupby('city')['sales'].sum()` return?
Question 6 of 10
Which attribute gives the number of rows and columns as a tuple?
Question 7 of 10
What does `top` contain?
top = df.sort_values('sales', ascending=False).head(3)
Question 8 of 10
By default, which columns does `df.describe()` summarise?
Question 9 of 10
What is printed?
a = pd.Series([1, 2], index=['x', 'y'])
b = pd.Series([10, 20], index=['y', 'z'])
print((a + b).tolist())
Question 10 of 10
After `pd.concat([df1, df2])`, `df.loc[0]` returns two rows. Why?