ndrary의 shape 조절 함수 reshape(): 원하는 형태 (shape)으로 ndarray의 shape을 조절 rave(): 1차원 vector (1차원 ndarray)로 shape을 변형 둘 다 view만 바꿈 resize(): reshape()과 상당히 유사 reshape()은 요소가 갯수가 맞지 않으면 안되지만 resize()는 요소의 갯수가 맞지 않아도 shape이 변경된다. 1. reshape() 함수 ndarray는 shape을 가지고 있다. shape 속성의 값을 바꾸어서 ndarray의 형태를 변경하는 것은 그다지 좋지 않다. 대신, reshape() 함수를 사용한다. 1) reshape()은 새로운 ndarray를 만드는게 아니라, View를 생성한다. import numpy a..

랜덤으로 ndarray 생성하기 ndarray를 생성할 때 랜덤값 기반으로 생성할 수 있다. 총 5가지 방법으로 ndarray를 생성할 수 있다. np.random.normal() np.random.rand(d0, d1, d2.. ) np.random.randn() np.random.ranadint(low, high, shape) np.random.random(shape) 1. np.random.normal() 정규분포(평균, 표준편차 이용) 확률밀도함수에서 실수 표본을 추출해서 ndarray 생성 mean = 50 # 평균 std = 2 # 표준편차 arr = np.random.normal(mean, std, (10000, )) # 난수 10000개 추출 print(arr) # [44.50727651 ..

Python의 list를 가지고 ndarray 생성 import numpy as np ## Python의 list부터 살펴보자 # literal : 자료구조를 코드 상에서 표현하는 방법 a = [1, 2, 3, 4, 5] # python의 list print(a) # [1, 2, 3, 4, 5] => list의 literal print(type(a)) # ## Numpy의 ndarry 만들기 - Python의 list를 가지고 arr = np.array([1, 2, 3, 4, 5]) print(arr) # [1 2 3 4 5] => ndarray의 literal print(type(arr)) # print(arr.dtype) # int32 (int: 정수, 32: 32bit) - ndarray는 같은 d..
칸 하나를 cell이라고 부른다. a key: 현재 cell 위쪽에 새로운 cell을 생성한다. b key : 현재 cell 아래쪽에 새로운 cell을 생성한다. dd key : 현재 cell을 삭제 ctrl + enter : 현재 cell을 실행 Numpy Numpy : Numperical Python 수치 계산에 최적화된 Python module vector, matrix 연산에 특화되어 있다. Pandas, Matplotlib의 기반이 되는 module machine learning, deep learning에서 많이 사용된다. ndarray의 특징 Numpy는 ndarray라고 불리는 n-차원의 배열을 제공한다. python의 list와 상당히 유사하다. python의 list는 다른 데이터 타입..
branch 기본 명령어 브랜치 목록 $ git branch 브랜치 생성 $ git branch {브랜치이름} 브랜치 이동 $ git checkout {브랜치 이동} # 브랜치 생성 및 이동 $ git checkout -b {브랜치 이름} 브랜치 병합 (master)$ git merge {브랜치이름} {브랜치이름}을 (master)로 병합 브랜치 삭제 $ git branch -d {브랜치 이름}  Branch 상황 3가지 작업 # 어쨌든 시작은, root-commit이 있어야 작업된다. $ touch README.md $ git commit -m "Init" [master (root-commit) bce28b7] Init 1 file changed,..

Git 기초 (20200821~22) Git은 분산형 저장 관리 시스템 (DVCS)이다. CVSC (Centeralized Version Control System) : subversion DVCS (Distributed Version Control System) : Git (무료) Git을 윈도우에서 활용하기 이해서는 git_bash를 설치해야 한다. Git은 Version Control System 자체고 GitHub는 Remote Repository에 저장하기 위한 프로그램 0. 전체 도식 1. 저장소 초기화 $ git init Initialized empty Git repository in C:/Users/i/Desktop/TIL/.git/ (master) $ 로컬 저장소를 만들고 나면, .git..

마크다운 문법 제목 제목은 #로 표현 가능 하다. 제목 3 제목 4 제목 5 제목 6 목록 목록은 순서가 없는 목록이 있다. 탭을 통해 목록 수준을 표현할 수 있다. 엔터, 탭 가지고 목록 들어갔다 나왔다 한다. 엔터 순서가 있는 목록도 있다. 엔터를 누르고 *을 하면 섞어서 쓸 수도 있다. 굳ㅋ 코드 블록 print('hello') # 이것은 주석입니다. # 주석 아님 안녕 링크 외부 URL : google 특정 파일의 상대 경로 : README 이미지 파일 z 위와 같이 절대경로로 표현하면, Github 등에서 파일이 존재하지 않아 이미지가 제대로 출력되지 않는다. 따라서, typora에 다음과 같은 설정을 해보자. .jpg) 상..
! 연습용으로 root 비밀번호 복구시엔 반드시 복구 전에 스냅샷 걸어놓기!!! 하다가 에러나서 바뀐 비번도, 바꾸기 전 비번도 다 안먹는 사태가 벌어질 수 있다 1. Centos 시작하고 엔터 눌러서 로그인 화면으로 넘어가기 전 화면 찍고 e 2. linux16 quiet rd.break LANG=en_US.UTF ( rd.break만 넣고 나머지는 그냥 둬도 되는 것 같다) 3. ctrl+x 눌러서 화면 빠져나오면 명령창이 뜬다 4. switch root:/# mount | grep sysroot (ro,relatime mount -o remount,rw /sysroot mount | grep sysroot (rw, relatime chroot /sysroot passwd root 암호 새암호 입력r..