Thank you. I read it the other way too!
Sorting in pandas:
print(df) 0 1 2 0 354.7 April 4.0 1 55.4 August 8.0 2 176.5 December 12.0 3 95.5 February 2.0 4 85.6 January 1.0 5 152 July 7.0 6 238.7 June 6.0 7 104.8 March 3.0 8 283.5 May 5.0 9 278.8 November 11.0 10 249.6 October 10.0 11 212.7 September 9.0
Sorting by month:
In : df.sort_values('2') Out: 0 1 2 4 85.6 January 1.0 3 95.5 February 2.0 7 104.8 March 3.0 0 354.7 April 4.0 8 283.5 May 5.0 6 238.7 June 6.0 5 152.0 July 7.0 1 55.4 August 8.0 11 212.7 September 9.0 10 249.6 October 10.0 9 278.8 November 11.0 2 176.5 December 12.0
Question is worded so terribly…
Came here to say this! Had to click on the hint, which clarified what was actually needed. Silver lining is I got to practice a lot of ways to analyze data frames while looking for what I was getting wrong.
Got it! It took a while to figure it out.
It would be nice if the question text could be updated to stop all the confusion and frustration. Thanks!
How To Keep Playing With The Data Sets
If you want to know how to keep playing with the data sets after the challenge has been completed/submitted, check out bruvark’s awesome workaround in the below link.
The suggested work around looks daunting and complicated at first, but it’s actually very straightforward. I can try to help anyone that has trouble with this!
When using groupby, if the output is not displayed by group of values in the column, what could I do be doing wrong? That is, it did not group values by neighborhood, output displayed each value of neighborhood as a separate row, instead of grouping them by the split constraint
There is! Check out the below link for a workaround. It seems complicated or difficult at first, but it’s actually very straightforward! I can help if you want/need any.
Yes, the lack of proofreading is insane. You’d think that would be really important in this area. Anyway, I really appreciate all your helpful comments in these forums.
Maybe Your Code Is Fine
Do you see a neighborhood in more than one row? If each neighborhood is only showing up in one row, than it seems to me that the
groupby() method is working just fine.
Possible Source Of Error In Your Code
But if you see the same neighborhood repeated in more than one row, maybe what’s going on is you passed the wrong parameter to the
If that’s the problem, you need to pass the correct parameter, haha. Wish I could say more, but I think that telling you exactly what column to group by (and therefore what column name to pass to the
groupby() method) would be too close to the answer and might get this comment deleted lol. gl!
I did see the same neighborhood repeated in more than one row. I’ll wait to see the solution tomorrow then haha! I think I messed up the syntax. Thank you anyway!
Thank you for this! I was surprised to see my answer incorrect.
Hi Kelvine95. Like other have said, I misread the question and hence answered “incorrectly”. It hurts a bit. Can this challenge be reset?
Hi all, I will be moderating the forum for the next 2 hours. Please let me know if you face any barriers in attempting to complete todays challenge. Also, please remember to not share any answers on this forum.
Anyone else get caught up on the American spelling of neighbourhood? Thankful for descriptive error messages!
**The way this god awfully question is horrendously worded costed one or more of members on my team their points for the day. Everybody was looking for the highest average price and max size in sq ft. Person who worded this should be laid off for a month and for me to provide free ESL lessons.
Refund ASAP please
Hi Paul, thank you for addressing this and sharing this write-up. We appreciate the feedback!
Hi there! Happy to issue a refund. Where should we send the $0 you paid to register for this free challenge?
Jokes aside, we have no problems acknowledging that there is room for improvement here. We are taking a hard look at upcoming challenges and doing our best to prevent this from happening again.
I can assure you, however, that no one is getting laid off and your generous offer for ESL lessons will not be necessary. At all.
What I understood just by reading the instructions:
Which neighborhood has the highest average property price and the highest size_in_sqft?
get A neighborhood that has both conditions. If this was a SQL query:
select neighborhood, ***** avg_price, ***** avg_size from df GROUP BY neighborhood ORDER BY avg_price, avg_size *****
(I censored some parts of the logic).
It could also be understood as avg price & max size.
I just understood that this was not the case by testing the answers. Please fix the writing of your questions. This could make people fail their first 2 attempts. I’m aware of these mistakes in the instructions, so I test them many times before submitting them. I’m just assuming that instructions_wrong=True by default.