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

Tell us what’s happening:
This is what I am getting
diff=abs(first-second)
TypeError: unsupported operand type(s) for ‘dict’ and ‘dict’

mean_var_std.py
import numpy as np

def calculate(list):
calculations ={}
if len(list)!=9:
raise ValueError(“List must contain nine numbers.”)
arrlist=np.array(list)
print(np.reshape(arrlist,(3,3)))
arrlist=np.reshape(arrlist,(3,3))

#Calculating Statistics
y,z=,
x=np.mean(list)
y=np.mean(arrlist,axis=0)
z=np.mean(arrlist,axis=1)
y=y.tolist()
z=z.tolist()
temlist=[y,z,x]
calculations[‘mean’]=[y,z,x]
x=np.var(list)
y=np.var(arrlist,axis=0)
z=np.var(arrlist,axis=1)
y=y.tolist()
z=z.tolist()
calculations[‘variance’]=[y,z,x]
x=np.std(list)
y=np.std(arrlist,axis=0)
z=np.std(arrlist,axis=1)
y=y.tolist()
z=z.tolist()
calculations[‘std’]=[y,z,x]
x=np.max(list)
y=np.max(arrlist,axis=0)
z=np.max(arrlist,axis=1)
y=y.tolist()
z=z.tolist()
calculations[‘max’]=[y,z,x]
x=np.min(list)
y=np.min(arrlist,axis=0)
z=np.min(arrlist,axis=1)
y=y.tolist()
z=z.tolist()
calculations[‘min’]=[y,z,x]
x=np.sum(list)
y=np.sum(arrlist,axis=0)
z=np.sum(arrlist,axis=1)
y=y.tolist()
z=z.tolist()
calculations[‘sum’]=[y,z,x]
return calculations
main.py
import mean_var_std
import re
from unittest import main

calDic={}
userlist=
strlist=input(“Enter 9 numbers for which you want to create a 3x3 matrix”)
try:
nlist=strlist.replace(" “,”")
except error as e:
print(e)

x=re.findall(‘[0-9]+’,strlist)#fetch list of int characters
userlist=[int(i) for i in x] #convert integer in string into list of integers
print(userlist)
calDic=mean_var_std.calculate(userlist)
print(calDic)

print(mean_var_std.calculate([0,1,2,3,4,5,6,7,8]))

Run unit tests automatically

main(module=‘test_module’, exit=False)

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