import numpy as np
a = 1
b = 2
c = 3
d = 4
e = 5 
f = 6
g = 7
h = 8
i = 9
M = np.array([[a,b,c],[d,e,f],[g,h,i]])
print(M)
print()

M_s = 1/2*(M + np.transpose(M))
M_a = 1/2*(M - np.transpose(M))

M = M_s + M_a
print(M_s)
print()
print(M_a)
print()

if np.all(M_s) == np.all(np.transpose(M_s)):
    print("true")
if np.all(M_a) == np.all(np.transpose(M_a)):
    print("true")
if np.all(M) == np.all(np.transpose(M_s + M_a)):
    print("true")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: