import numpy as np
x = [[11,22],[33,44]]
y = [[55,66],[77,88]]
x1 = np.array([[11,22],[33,44]], dtype=np.int32)
y1 = np.array([[55,66],[77,88]], dtype=np.int32)
print("ADD USING LIST\n",x + y)
print("ADD NUMPY ARRAY\n",np.add(x1, y1))
Solve Problems by Coding Solutions - A Complete solution for python programming
Datatypes in Numpy
import numpy as np
x = np.array([101, 202])
print(x.dtype)
x = np.array([11.75, 21.75])
print(x.dtype)
x = np.array([1, 2], dtype=np.int64)
print(x.dtype)
x = np.array([1, 2], dtype=np.complex128)
print(x.dtype)
x = np.array([101, 202])
print(x.dtype)
x = np.array([11.75, 21.75])
print(x.dtype)
x = np.array([1, 2], dtype=np.int64)
print(x.dtype)
x = np.array([1, 2], dtype=np.complex128)
print(x.dtype)
Subscribe to:
Posts (Atom)