Hi! I would like some help with the test in the Data Analysis with Python course exercises.
The Mean-Variance-Standard Deviation Calculator project fails the test cases because it cannot test if two lists in the dictionary are similar. As far as I can tell, the tests crash not because of my own code in the exercise. Stacktrace below:
Traceback (most recent call last):
File "/home/runner/boilerplate-mean-variance-standard-deviation-calculator-2/test_module.py", line 54, in test_calculate2
self.assertAlmostEqual(
File "/usr/lib/python3.8/unittest/case.py", line 937, in assertAlmostEqual
if first == second:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I acutualy fixed the test myself by using a pandas testing function. But if the tests are indeed broken from the start, someone should fix them, before (more) people get confused. If the test function as expected, and i did something stupid; please let me know!
The Demographic Data Analyzer test seem also broken. The values match more or less with the answers my code generates, but not close enough. I first thought my code was bad. However, after calculating the average male age manually in excel, I discovered my answer is actually correct, down to 7 decimals accurate. I’m not sure if the other failing test, fail because of faulty code of mine, or if the tests aren’t accurate enough.
Thanks for reading, and hopefully this can be resolved