Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAFun quick challenge to tackle. Too bad that about 6,2% of the yarns have more than one possible candidate for primary fiber, as these fibers all have the same, maximum percentage within the yarn ID. This can skew the outcomes based on the method of determinig the primary fiber and the way the data is sorted.
The maximum number of fibers that qualify as primary is 4. The is the case for 5 yarns.
Also, task 2 shows a slight difference in the review score of the 2nd category.
Not quite sure why, as it isn't because the average review scores aren't weighed in this solution, as it should be for more accurate analysis (an average of an average rarely is a good idea).
I have a hint for those struggling to get the numbers to match exactly.
MY HINT:
When in doubt its a vegetable fiber
Apologies if anyone thinks this deserves spoiler quote but I think the OP just used a lazy (albeit more efficient) IF statement. Perhaps that's a lesson for everyone. When I'm using an if statement to create categories, I always try to make the final "Else" result be an "Error" that way if there was a scenario I didn't anticipate it will show in the results and then I can go back an add the scenario.
My solution:
I also added an alternative to the task 1. My solution includes two scenario which I think are reasonable include and would have made the challenge perhaps more interesting.
- Scenario 1 - All NA were excluded but in cases where the fabric only had one fiber I think its reasonable to include (523 yarns)
- Scenario 2 - In cases where was more than one fibre with the highest content, the results just took the first as it appeared in the table. My solution used the fiber type ID to break the tie. Not sure that's that the best but at least it ensures something consistent. (6965 yarns)
I agree that the average of averages is not the correct calculation to use. I did mine both ways. I got the the same answers with both options, but different averages.
Sorry for the messy looking solution. Average in task two is minimaly off. Tried to calculate a weighted average first, but that was shooting a bit too far as I quickly realized. Did some further troubleshooting, but could not find a reason for the number being different.