Answers for "python create 4x4 matrix"

1

python create 4x4 matrix

import numpy as np
x = np.zeros((4, 4))
x[::2, 1::2] = 1
x[1::2, ::2] = 1
print(x)
Posted by: Guest on May-24-2020

Python Answers by Framework

Browse Popular Code Answers by Language