Data Analysis with Python Projects - Mean-Variance-Standard Deviation Calculator Tests Errors

I am getting errors for the test, I have tried creating a new replit, I have also tried deleting the lockfile and toml file.
I gives the desired result in my vscode but no on replit

{'mean': [array([3., 4., 5.]), array([1., 4., 7.]), 4.0], 'variance': [array([6., 6., 6.]), array([0.66666667, 0.66666667, 0.66666667]), 6.666666666666667], 'standard deviation': [array([2.44948974, 2.44948974, 2.44948974]), array([0.81649658, 0.81649658, 0.81649658]), 2.581988897471611], 'max': [array([6, 7, 8]), array([2, 5, 8]), 8], 'min': [array([0, 1, 2]), array([0, 3, 6]), 0], 'sum': [array([ 9, 12, 15]), array([ 3, 12, 21]), 36]}
EE.
======================================================================
ERROR: test_calculate (test_module.UnitTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/boilerplate-mean-variance-standard-deviation-calculator/test_module.py", line 10, in test_calculate
    self.assertAlmostEqual(actual, expected, "Expected different output when calling 'calculate()' with '[2,6,2,8,4,0,1,5,7]'")
  File "/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/unittest/case.py", line 870, 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()

======================================================================
ERROR: test_calculate2 (test_module.UnitTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/boilerplate-mean-variance-standard-deviation-calculator/test_module.py", line 15, in test_calculate2
    self.assertAlmostEqual(actual, expected, "Expected different output when calling 'calculate()' with '[9,1,5,3,3,3,2,9,0]'")
  File "/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/unittest/case.py", line 870, 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()

----------------------------------------------------------------------
Ran 3 tests in 0.013s

FAILED (errors=2)

Your code so far

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Data Analysis with Python Projects - Mean-Variance-Standard Deviation Calculator

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

I guess you already fixed this? When I run it everything is good

Ran 3 tests in 0.046s

OK

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.