일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 리눅스 저장 용량 확인
- 파이썬 테마
- 딥러닝 제대로 시작하기
- CSS Fraud Score
- ORACLE NULL값 처리
- SQL NVL
- linux 폴더 용량 확인
- jupyter notebook PDF
- 회수모형
- ORACLE SQL NVL
- Cudnn 버전 확인
- 파이썬 이미지 불러오기
- 신용평가 부정사용 평점
- SQL NULL값 처리
- Python Numpy
- 신용평가 Fraud
- 딥러닝
- ORACLE 상위 행 추출
- 주피터노트북 테마 변경
- 행동평점
- jupyter notebook 테마 변경
- 주식 데이터 수집
- 파이썬 이미지 라벨 저장
- python image load
- python pandas
- 파이썬 이미지 리스트 변환
- linux 폴더 크기 확인
- 신청평점
- ORACLE 상위 N개 추출
- python image list
- Today
- Total
목록Python (35)
koos808
Numpy 배열 길이 확인 방법 data.shape or len(data) Numpy의 around() 함수 반올림 함수 np.round(data, 2) or np.around(data, 2) 사용 Numpy 배열에서 원소(value) 몇 개씩 존재하는지 count(R에서의 table) # example 1 from collections import Counter Counter(jaffe_Y) # example 2 result = Counter(jaffe_Y) print(result) for key in result: print(key, result[key]) # example 3 import numpy as np x = np.array([1,1,1,2,2,2,5,25,1,1]) y = np.bincou..
Numpy Function np.random.rand() : Numpy의 random 모듈은 랜덤 값 생성을 위한 rand() 함수를 제공함. 0에서 1사이의 값을 생성하여 반환함. randint(low, high=None) 함수는 high를 넣지 않은 경우에는 0에서 low사이의 정수를 랜덤으로 생성하고 high를 넣은 경우 low에서 high 사이의 정수를 생성함. np.argmax() : argmax(array) 함수는 입력으로 들어온 array에서 가장 큰 값의 위치를 반환한다. 예를 들어 array = [3,5,7,0,-3] dlaus 가장 큰 값은 7이고 그 위치는 2이다. np.argmax(array) => 2 Numpy의 reshpe() 함수 ndarray를 reshape() 함수를 써서 ..
이미지 처리 관련 이미지 resize 후 저장(이미지 용량 줄이기 및 사이즈 변환 후 저장하기) from PIL import Image import os raw_path = './frame_data/' # 원본 이미지 경로 token_list = os.listdir(raw_path) # 원본 이미지 경로 내 폴더들 list data_path = './300size_data/' # 저장할 이미지 경로 # resize 시작 -------------------- for token in token_list: #원본 이미지 경로와 저장할 경로 이미지 지정 image_path = raw_path + token + '/' save_path = data_path + token + '/' # 저장할 경로 없으면 생성 i..
폴더 안의 파일명을 일괄적으로 바꾸는 방법에 대해서 알아보겠습니다. 파일명 일괄 변경 및 문자열 split(분할) 문자열로 구성된 리스트에서 "jpg" 기준으로 스플릿하고 첫번째 원소 가져오기 [i.split('jpg')[0] for i in ex_list] : ex_list는 list 그냥 문자열(ex_list의 0번째 원소)에서 'jpg'기준으로 split하기 ex_list[0].split('jpg')[0] 문자열 리스트에 'jpg' 붙혀주기 [i + 'jpg' for i in ex_list] 파일명 한번에 일괄 변경하기 data_path = './Augmentation images/aug_class2' files_list = os.listdir(data_path) # 파일명에 번호 추가하기 (중복 ..
각 array(ex.2차원 배열)에서 max값만 추출하는 방법 numbers = [0, 0, 1, 0, 0, 1], [0, 1, 0, 2, 0, 0], [0, 0, 2, 0, 0, 1], [0, 1, 0, 3, 0, 0], [0, 0, 0, 0, 4, 0] >>> map(max, numbers) >>> list(map(max, numbers)) [1, 2, 2, 3, 4] >>> max(map(max, numbers)) 4 >>> import numpy as np >>> np.max(numbers) 4
Numpy 배열 합치기 & append로 배열 추가하는 방법 np.concatenate((data1, data2), axis = None) np.concatenate((data1, data2.T), axis = 0) np.concatenate((data1, data2), axis = 0) np.append(a1, a2) array append(array list처럼 append로 쌓기) 쌓을 shape을 먼저 만들어 준다 : stack = np.empty([0,224,224,3]) 만든 shape에다가 append해준다 : aoa = np.append(stack,[input_img_resize], axis=0) Array말고도 List를 append하는 방법은 아래와 같다. List에서는 append를 ..
# 각 array(ex.2차원 배열)에서 max값만 추출하는 파이썬 코드 numbers = [0, 0, 1, 0, 0, 1], [0, 1, 0, 2, 0, 0], [0, 0, 2, 0, 0, 1], [0, 1, 0, 3, 0, 0], [0, 0, 0, 0, 4, 0] >>> map(max, numbers) >>> list(map(max, numbers)) # max numbers from each sublist [1, 2, 2, 3, 4] >>> max(map(max, numbers)) # max of those max-numbers 4