일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- LLM
- numpy
- Python
- KAKAO
- Laravel
- GitLab
- TORCH
- Package
- enV
- git
- Flask
- 책갈피
- DB
- PostgreSQL
- format
- Converting
- docker
- AI
- file
- list
- Container
- Database
- pandas
- Linux
- Windows
- judge
- pytorch
- Mac
- Paper
- evaluation
- Today
- Total
목록Python (35)
Daily Develope
1. Conda/Anaconda 설치ㅇ 아나콘다 페이지의 설치환경 및 방법 참고curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.shsh Miniconda3-latest-MacOSX-arm64.sh ㅇ 사용방법 2. pytorch 설치[참고 - pytorch][참고 - 이전버전]ㅇ 아키텍처 확인>>> import platform>>> platform.platform()'macOS-15.3.1-x86_64-i386-64bit'x86 인 경우 cpuonly 환경 설치 필요arm 인 경우 기존(아래) 방법으로 설치 설치 방법 1 - Anaconda (25.02 기준 v2.5 이하 지원)# case x86) 설치conda ins..
일반 반올림 (오사오입)python의 기반 round 함수를 사용하는 경우 오사오입이 적용된다. (올림 자리수가 5인 경우 그 앞자리가 홀수면 올리고 짝수면 내림)print(round(3.5, 0)) # 출력값 : 4print(round(4.5, 0)) # 출력값 : 4decimal 사용 (사사오입)일반적으로 알고있는 반올림 방법import decimalctx = decimal.getcontext()ctx.rounding = decimal.ROUND_UPprint(round(decimal.Decimal(3.5), 0)) # 출력값 : 4print(round(decimal.Decimal(4.5), 0)) # 출력값 : 5 주의사항 : 반올림 후 결과의 type은 Decimal 이므로 필요에 따라 형변환 수행.
설치python -m pip install --upgrade pippython -m pip install pandaspython -m pip install openpyxlpython -m pip install xlsxwriter# xlsxwriter은 파일을 쓸 때 인코딩 혹은 문자깨짐으로인한 오류를 처리하기 위해 설치기능엑셀파일 불러오기import pandas as pddataset = pd.read_excel("{파일경로}/{파일명}.xlsx", header=0) 엑셀파일 저장하기 단일 Sheet 저장import pandas as pd# 1) data frame 생성my_header = ["단어", "단어 길이"]my_data = [["바나나", "3"], ["사과", "2"], ["대머리독수리", ..
의미 Type checking을 위해 데이터의 유형을 명시적으로 나타내기 위해 사용하는 Class (또는 Type) 자주 사용되는 Type Any : 모든 Type과 호환되는 Type Union : Union 리스트에 선언된 Type 중 하나에 해당함을 의미 def foo(arg: Union[int, float] = None) -> None: # arg는 int 또는 float 유형 # ... Optional : Optional 리스트에 선언된 Type이거나 None인 경우를 의미 def foo(arg: Optional[int] = None) -> None: # ... 가끔 사용되는 Type NoReturn : function의 반환값이 없음을 명시적으로 표현 from typing import NoRet..