Maksim-Sheyngalts / PythonTool

1 stars 0 forks source link

NumPy #1

Open Maksim-Sheyngalts opened 2 years ago

Maksim-Sheyngalts commented 2 years ago

np.zeros((3,4)) Create an array of zeros np.ones((2,3,4),dtype=np.int16) Create an array of ones d = np.arange(10,25,5) Create an array of evenly spaced values (step value) np.linspace(0,2,9) Create an array of evenly spaced values (number of samples) e = np.full((2,2),7) Create a constant array f = np.eye(2) Create a 2X2 identity matrix np.random.random((2,2)) Create an array with random values np.empty((3,2)) Create an empty array