
- shape은 디버깅하기 좋은 api이다.
- 알고리즘 검정을 meta-data api들로 검정해보기

#Meta-data of ndarrays
import numpy as np
scalar_np = np.array(3.14)
vector_np = np.array([1,2,3])
matrix_np = np.array([[1,2],[3,4]])
tensor_np = np.array([[[1,2,3],[4,5,6]],[[11,12,13],[14,15,16]]]) #괄호의 개수가 차원의 개수임
print("shape / dimension")
print("{} / {}".format(scalar_np.shape, len(scalar_np.shape)))
print("{} / {}".format(vector_np.shape, len(vector_np.shape)))
print("{} / {}".format(matrix_np.shape, len(matrix_np.shape)))
print("{} / {}".format(tensor_np.shape, len(tensor_np.shape)))
'''
() / 0
(3,) / 1
(2, 2) / 2
(2, 2, 3) / 3
'''
a = np.array([1,2,3]) #(3,)
b = np.array([[1,2,3]]) #(1,3)
c = np.array([[1],[2],[3]]) #(3,1)
#ndarray.size
import numpy as np
M = np.ones(shape = (10,))
N = np.ones(shape = (3,4))
O = np.ones(shape = (3,4,5))
P = np.ones(shape = (2,3,4,5,6))
print("Size of M:", M.size) #Size of M: 10
print("Size of N:", N.size) #Size of N: 12
print("Size of O:", O.size) #Size of O: 60
print("Size of P:", P.size) #Size of P: 720