Numpy Numpy (Numerical Python) 파이썬의 고성능 과학 계산용 패키지 matrix, vector 등 array 연산의 표준 list에 비해 빠르고 메모리 효율적 반복문 없이 배열 처리 지원 dynamic typing을 포기함으로써 comprehension 이상의 연산 속도를 얻음. static / dynamic type 의 pros & cons ndarray np.array([1,4,5,8], dtype = np.float32) ndarray 객체 하나의 데이터 타입만 배열에 넣을 수 있음 dynamic typing not supported scalar, vector, matrix, n-tensor indexing, slicing array[0][2], array[0,2] array..
정리하게 된 계기 from sklearn.cluster import KMeans # r,g,b 단위로 한줄로 reshape X = image.reshape(-1,3) # 비슷한 색상(군집) 8개로 모음 kmeans = KMeans(n_clusters=8,random_state=13).fit(X) # 센터값만 저장 segmented_img = kmeans.cluster_centers_[kmeans.labels_] # 센터 값을 이미지로 바꿔서 봄 segmented_img = segmented_img.reshape(image.shape) 답변 스터디 팀원 분께서 관련한 링크를 찾아 보내주셨다. 링크 : https://bytemeta.vip/repo/ageron/handson-ml2/issues/489 [QU..