I am getting error ‘ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()’.

How do I fix this?

My code:

```
import numpy as np
def calculate(list):
if len(list) < 9:
raise ValueError("List must contain nine numbers.");
else:
arr = np.array(list).reshape(3,3)
a = np.mean(arr, axis = 0)
b = np.mean(arr, axis = 1)
c = np.mean(arr)
d = np.var(arr, axis = 0)
e = np.var(arr, axis = 1)
f = np.var(arr)
g = np.std(arr, axis = 0)
h = np.std(arr, axis = 1)
i = np.std(arr)
j = np.max(arr, axis = 0)
k = np.max(arr, axis = 1)
l = np.max(arr)
m = np.min(arr, axis = 0)
n = np.min(arr, axis = 1)
o = np.min(arr)
p = np.sum(arr, axis = 0)
q = np.sum(arr, axis = 1)
r = np.sum(arr)
calculations = {
'mean': [a,b,c],
'variance': [d,e,f],
'standard deviation': [g,h,i],
'max': [j,k,l],
'min': [m,n,o],
'sum': [p,q,r]
}
return calculations
```