text_plain_output_1.png
import numpy as np

import numpy as np

import numpy as np

import time

a = np.array([2, 3, 4, 5])

c = np.arange(10)

np.arange(10, 20, 2)

a.shape

a = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])
a

a.shape

a.ndim

a = np.ones([3, 4])
a

b = np.zeros([3, 5])
b

c = np.eye(3)
c

d = np.diag([1, 2, 3])
d

np.diag(c)

a = np.array([[311, 312, 313], [321, 322, 323], [331, 332, 333]])
a

b = np.array([[211, 212, 213], [221, 222, 223], [231, 232, 233]])
b

c = np.array([[111, 112, 113], [121, 122, 123], [131, 132, 133]])
c

d = np.array([a, b, c])
d

a = np.array([[[311, 312, 313], [321, 322, 323], [331, 332, 333]], [[211, 212, 213], [221, 222, 223], [231, 232, 233]], [[111, 112, 113], [121, 122, 123], [131, 132, 133]]])
a

a.ndim

initial_time = time.time()
a = 0
for i in range(1000000):
    a = a + i
print(a)
final_time = time.time()
diff1 = final_time - initial_time
diff1