I am studying for an exam and encountered this problem from past worksheets: enter image description here

This is the data frame called 'contest' with granularity as each submission of question from each contestant in the math contest. The question is

enter image description here and the answer is in red. I get why that works, but why is the 4th choice wrong? I really can't figure it out - please help.

*please let me know if this is not allowed as a post in this community.

for full description of the problem:

In this question, we will be looking at the contest dataframe which contains data from a math contest in 2019. In the contest, each participant had a total of five questions. The participants submit each question separately and each row of the DataFrame records a particular submission of one of the contestants by some participant. The Timestamp column specifies the time a given problem is submitted by a participant; each timestamp is discretized to the minute and has been properly converted to a Pandas datetime object with pd.to datetime. The Contestant column contains the id-name pair of each participant. The Question column contains the question that was submitted. The Correct column tells us if the answer given in the submission is correct (1) or not (0). Assume each participant can have several submissions for the same problem, but they can only submit one question per minute.


1 Answer 1


If the participant has answered the question 2 before the question 1, you will lose the information on question one by using .agg("first") in the 4th option


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.