본문 바로가기

Python5

주로 사용하는 matplotlib setting 전체 그래프 세팅 plt.rc('font',family='Malgun Gothic', size = 20, weight = 'bold') #한글폰트 적용 plt.rc('figure',figsize = (10,7)) #크기설정 plt.rc('axes', grid = True) #격자 on,off #plt.rc('lines', color = 'y', linewidth = 4,linestyle = '--') # 라인설정 #plt.rc('grid', color = 'k', linewidth = 1, linestyle = ':')# 그리드설정 #plt.rc(&.. 2021. 3. 15.
Geometry contains, within within/ contains a.contains(b) == b.within(a) 관계가 성립된다. contains Geometry 객체가 다른 Geometry객체(전부)를 포함하는지 여부를 리턴 within Geometry 객체가 다른 Geometry객체에 포함되는지 여부를 리턴 -> 한글 설명으로 이해하려니 어렵다. 또한 포함이란 단어가 중복되어 헷갈린다 예제코드 import geopandas as gpd from shapely.geometry import Point, Polygon,LineString #아래와 같이 샘플용 데이터 생성 point1 = Point(5,5) point2 = Point(3,3) polygon1 = Polygon(((0,0),(0,10),(10,10),(10,0))) pol.. 2020. 12. 9.
geopandas geopandas 설치순서 참고 pyproj Shapely GDAL cligj munch click-plugins Fiona geopandas descartes 2020. 10. 13.
[텍스트마이닝] python에서 pdf읽기 다양한 모듈을 설치해서 실행해봤지만, 실패한 것들이 많았고 (사용법을 몰라서 혹은 파일자체가 안맞아서) 최종적으로 사용한것은 pdftotext, PyMuPDF 2개 시도한것 pyPDF2, ocrmypdf, pdftotree, pdfminer pdftotree깃헙 pdfminer깃헙 교훈 예전에 어떤 선생님께서 모듈,라이브러리 싸움이라고 하셨는데 pdf 관련해서 엄청나게 많은 모듈이 있는 걸 알게됬고, 이걸 바로바로 습득하는 게 진짜 능력이지 않나 싶다 물론 모듈 찾아내는 것 포함 (거의 반나절 다썼다) 설치법 pip install pdftotext pip install PyMuPDF pdftotext fileReader = pdftotext.PDF(file) page_sentences = fileRead.. 2020. 4. 8.
주피터 노트북 확장 (Jupyter notebook nbextension) Jupyter notebook nbextension 쥬피터 노트북의 확장기능을 사용할수 있게 해준다 아래과 같은 방법으로 설치한다 nbextension pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install --user 현재 사용하고 있는 확장모드 다양한 기능이 많지만 추천하는 기능 1.Variable inspector - 변수명을 확인 및 크기를 알려준다 2.ExecuteTime - %%time과 동일한 기능으로 cell이 실행된 시간을 알려줌 3.Codefolding - 긴 코드를 접어놓을 수 있음 4.datestamper - 현재 날짜,시간을 도장처럼 입력가능 5.Move Selected cells - Alt U.. 2020. 2. 3.