[Numpy] 배열 생성과 형태, 브로드캐스팅
넘파이 가져와서 배열 생성하기축의 개수: x.ndim모양 확인: x.shape데이터 타입: x.dtype배열 타입: type(x)import numpy as npx = np.array([1.0, 2.0, 3.0])x.ndim # 1 //1차원 배열x.shape # (3,)x.dtype # dtype('float64')type(x) # numpy.ndarray 배열의 초기화- np.zeros(): 0으로 채우기zero = np.zeros((2, 3))array([[0., 0., 0.], [0., 0., 0.]]) - np.ones(): 1로 채우기one = np.ones((2, 3))array([[1., 1., 1.], [1., 1., 1.]]) - np.full(): 사..
2024. 4. 30.