| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- enV
- DB
- list
- TORCH
- Package
- PostgreSQL
- KAKAO
- Linux
- Python
- Laravel
- AI
- Windows
- docker
- judge
- GitLab
- format
- Mac
- numpy
- Database
- file
- evaluation
- LLM
- pandas
- Flask
- pytorch
- Converting
- 책갈피
- Container
- git
- Paper
- Today
- Total
목록Develope/Python (33)
Daily Develope
설치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"], ["대머리독수리", ..
Pickle이란? Python의 객체(Object)를 binary 파일로 serializing 하거나 반대로 binray 파일로부터 de-serializing 하기 위한 프로토콜이 구현된 라이브러리. 흔히 pickling, flattening, marshalling 등으로 일컫는다. 장점? Python 객체를 바로 파일로 쓰거나 읽을 수 있다. Binary(또는 Bytes) 형태로 데이터를 다루기 때문에 읽기/쓰기 속도가 빠르다. 읽기/쓰기 예시코드 import pickle import os my_filepath = "target/file/path/filename.bin" my_data = ['target', 'data'] if os.path.isfile(my_filepath): ### 읽기 with o..
환경Python 3.9.7- modules : psycopg2Postgresql (Container, version:alpine3.18)- host : 127.0.0.1- port : 5432- database : mydb- 컨테이너 배포 샘플코드Connection Classimport psycopg2import loggingclass DBBaseController: def __init__(self, host:str="127.0.0.1", port:int=5432) -> None: self.__connect(host=host, port=port) def __connect(self, host:str="127.0.0.1", port:int=5432): try: ..
방법 1. 내장 property method 클래스의 속성값에 대한 getter, setter, destructor 동작을 method로 정의하고, 내장함수인 property를 사용해 해당하는 속성과 연결시켜 사용. 샘플코드 # Python program showing a use of property() function class Geeks: def __init__(self): self._age = 0 # function to get value of _age def get_age(self): print("getter method called") return self._age # function to set value of _age def set_age(self, a): print("setter metho..