DQ request the answer is a dataframe but the question is asking for shape of dataframe

Screen Link:

https://app.dataquest.io/m/137/data-cleaning-walkthrough%3A-combining-the-data/13/performing-the-inner-joins

My Code:

list_combine=["class_size","demographics","survey", "hs_directory"]
for i in list_combine:
    combined=combined.merge(data[i], on = "DBN", how ="inner")
combined.head()
combined.shape

What I expected to happen:
I thought this is correct answer and when I check with the answer it’s the same.

What actually happened:

(363, 159)
combined isn’t defined in your code, but we expected it to be DataFrame type

When I replace my code with answer from dataquest, it show a dataframe. This confuses me because when the instruction asks for shape of “combined” dataframe, it must be a tupple of collumns and rows of the “combined” dataframe, not the “combined” datatframe itself.
Can anyone check for me that my understanding is wrong or the answer of dataquest is has an issue?
Thanks in advance.

@tranmaianh.hcm: The output (363, 159) is a tuple of the numbers of rows and columns. I could pass the mission test with your code. Kindly refresh your browser and try submitting again. Thanks!

1 Like