Need help for the AI4S - 6.0 ULCU-2 Exploratory Data Analysis Quiz last question
I am stuck on how to calculate the median of UnitPrice. When I used print(np.median(df['UnitPrice'])), I got 2.08 as the result, but this was wrong. I have tried to repeat this and extracted the data again, but I still got the same result, 2.08, and it is not the correct answer.
Anyone can assist me on how to answer this question?
Hey @Tree3!
You first need to filter the DataFrame using the conditions specified in the lesson before calculating the median price.
- We are only interested in transactions coming from the United Kingdom
- Where the CustomerID is not missing
- Where the Description is not missing
- Where the InvoiceNo does not start with 'C' (Look at the data description to see why)
- Quantity greater than 0
- Unit Price greater than 0
- The InvoiceDate is a full year between 11 Dec 2010 to 10 Dec 2011
At the same time, we are moving away from these sorts of 'free answer' questions because it's difficult to make progress if you're stuck. As such, I've amended the question to test the concept instead. Thanks for your question @Tree3!
Latest Post: Why KELABERTIV? Our newest member: joeiwsm Recent Posts Unread Posts Tags
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed