전체 글

detectron2를 설치하던 도중 certifi 버전이 없다고 오류가 뜬 상황. Detectron 설치 참고 사이트 Installation — detectron2 0.6 documentation © Copyright 2019-2020, detectron2 contributors Revision 8c4a333c. detectron2.readthedocs.io pip install 명령어에 --ignore-installed 옵션을 추가하여 설치하면 무시하게 됨. 기존 pip install에서 -ignore 옵션 추가 # Before pip install detectron2... # After pip innstall --ignore-installed detectron2 도움 주신 참고 링크 에러 발생 해결 ..
pdf 파일에서 페이지를 삭제하거나 PDF를 합병하고 싶을 때 다음 코드를 사용해서 돌리면 pdf파일을 내 맘대로 수정할 수 있다. 아래 코드는 한 부당 7페이지로 구성된 40부짜리 문서 중 앞에 있는 3부만 잘라내어 저장하는 스크립트다. import PyPDF2 if __name__ == "__main__": # target_path : pdf 문서가 있는 경로 target_path = "./문서_40부.pdf" pdf = PyPDF2.PdfReader(target_path) output = PyPDF2.PdfWriter() pageNum = len(pdf.pages) oneDoc = 7 # 한 부당 페이지 개수 for i in range(0, 3*oneDoc):#처음에 있는 3부만 따로 저장 page..
Multiindex를 갖고 있는 데이터 프레임을 그대로 excel로 떨어트리는 함수를 사용할 경우에 제목 행 바로 아래에 빈 행이 하나 생기게 된다. 이를 해결하기 위한 함수는 아래와 같다. 간단히, 제목만 떼서 저장하고, 이어서 내용에 해당되는 부분만 떼서 2번에 걸쳐 저장하는 함수라 보면 된다. def save_double_column_df(df, file_name, startrow = 0, **kwargs): '''Function to save doublecolumn DataFrame, to xlwriter''' # https://stackoverflow.com/questions/52497554/blank-line-below-headers-created-when-using-multiindex-and..
= FILTER(,찾고자 하는 범위=찾는 데이터) 참고 영상: https://youtu.be/OHQx744ZmVk?feature=shared
from pandas import DataFrame import pandas as pd df = DataFrame({'cost': [250, 150, 100],'revenue': [100, 250, 300]},index=['A', 'B', 'C']) print(df) print(df.eq(100)) import pdb; pdb.set_trace() score = df.eq(100).mean(axis=1) * 100 # axis=1 means row-wise # axis=0 means column-wise https://stackoverflow.com/questions/67763805/how-to-calculate-matching-percentage-difference-between-two-datafram..
docker rmi (dockerimagesf"dangling=true"q):https://jhkimmm.tistory.com/9[Docker]noneID..dockerrmi(djhkimmm.tistory.com
만약 중간에 서버 내 환경(나의 경우엔 OS가 변경됨)이 변경됐고, 그 외 IP나 user는 그대로인 경우에 이전에 등록했던 ssh 를 통해 접속할 경우 에러와 함께 접속이 불가능할 때가 있다. 이럴 경우 내부 local terminal로 접속해서 다음과 같은 known_hosts파일을 열어보자. 메모장이나 notepad로 해당 파일을 열고 관련된 서버 정보를 삭제해주면 이전에 저장됐던 값을 삭제하고 다시 제대로 접속할 수 있다.
docker build --no-cache -t something:tag .
import os from PIL import Image directory = "./images" image_files = natsorted([filename for filename in os.listdir(directory) if filename.endswith('.jpg')]) images = [Image.open(directory + '/' + f) for f in image_files] images[0].save("out.pdf", "PDF", resolution=100.0, save_all=True, append_images=images[1:]) # 1부터 저장해야지 안그러면 똑같은 페이지 하나 더 들어감