본문 바로가기

파이썬

(3)
tmux / tqdm 사용법(중단없이 멀티태스킹/진행률 프로그레스바_progress bar) 평소에 오래 걸릴만한 코드를 실행하지 않아서 사용하지 않았지만, 터미널에서 변화를 보이지 않아서 언제 끝날지도 모르겠고 실행이 되는 중인지 확인하기도 어려워서 for문에 tqdm을 넣어봤다. tqdm python에서 tqdm 라이브러리를 이용해 작업진행률을 확인할 수 있다. 필자는 tqdm을 쓰지 않고 코드 중간 중간 def run_successrates(self, version1, top_k): dataframe = self.get_df_wo_header() all_success_rates = list() for i in range(1, top_k + 1): try: success_rate = self.get_success_rates(i, dataframe) except KeyError: success..
excel에서 드래그로 인덱스 증가(숫자 늘리기)[기초] 엑셀에서 간혹 인덱스를 늘려서 동등하게 비교를 해야할 때가 있다. 손수 J1 셀의 오른쪽 하단 꼭지점을 눌러 오른쪽으로 드래그 하면 오른쪽으로 인덱스가 늘어났다. 이런 기능을 가진 파이썬 스크립트를 만들어보자! 작년에 한 3일 고민해서 만들었던 로직인데 하나의 파일에 해당해서 늘리는 방법만 우선 소개해보고자 한다. import pandas as pd sample = pd.read_excel("holo_single_dcc.xlsx") colab을 활용해서 간단하게 파일을 담아둔다. (colab에 파일 loading하는 방법 소개: google drive 구글드라이브를 코랩에 로딩(colab load)하기 (tistory.com)) sample 데이터를 출력해보면 위의 엑셀 파일의 데이터프레임과 동일함을 알..
ChatGPT로 파이썬 공부하는 방법 https://openai.com/blog/chatgpt Introducing ChatGPT We’ve trained a model called ChatGPT which interacts in a conversational way. The dialogue format makes it possible for ChatGPT to answer followup questions, admit its mistakes, challenge incorrect premises, and reject inappropriate requests. openai.com ChatGPT 간단한 가입절차 (google 로그인으로 간편 로그인 가능) 를 거치면 ChatGPT의 채팅방이 생성된다. 하단의 Send a message 란에 물어..