Mar-13-2019, 01:15 PM
how do you write a function that takes a matrix as a parameter
and for symmetric, skew and others returns respectively 1,-1 and 0?
here is what I have so far but I get errors.
and for symmetric, skew and others returns respectively 1,-1 and 0?
here is what I have so far but I get errors.
import numpy as np
a=1
b=2
c=3
d=4
e=5
f=6
g=7
h=8
i=9
def a(x):
return np.array([a,b,c], [d,e,f], [g,h,i])
def b(y):
return np.array([a,d,e],[b,e,h],[c,f,i])
if a(x)==b(y):
return 1
if A==(-1)*B:
return -1.
else:
return 0