Створення масивів класичним способом
list1 =[1, 3, 5, 7, 9]
list2 = [2, 4, 6, 8, 10]
list3 = range(0, 5 , 2)
print("list1 : " , list1)
print("list2 : " , list2)
print("list3 : " , list3)
Перемноження масивів (вручну)
new_list = []
d = 0
for i in range(0 , len(list1)):
d = list1[i] * list2[i]
new_list.append(d)
print("list1 * list2 : " , new_list)
Створення масивів за допомогою NumPy їх множення і вивід параметрів
import numpy as np
x = np.array(range(1, 10 , 2))
y = np.array(range(2, 11 , 2))
print(type(x))
print(x*y)
print(f"ndim: {x.ndim}")
print(f"shape: {x.shape}")
print(f"size: {x.size}")
print(f"dtype: {x.dtype}")