반응형

Python 51

[Python] Sequence Data Type - list

Sequence Data Type memership 연산: in 키워드 사용 size 함수: len(seq) slicing 속성: seq[:-1] iterability: 반복문에 있는 데이터를 순회할 수 있음 문자열, 튜플, 리스트, 바이트 배열, 바이트 등 5개의 내장 시퀀스 타입이 있음 list 대괄호 []을 이용하여 선언 모든 자료형을 담을 수 있음 삽입, 수정, 삭제 등이 자유로움 순서가 있는 자료형으로 인덱싱 슬라이싱 가능 list_1 = [1, 2, 'character', ['two', 'three'], ('tuple', 'inlist')] list_1[3] >> ['two', 'three'] list_1[4][0] >> 'tuple' 인덱싱 가장 바깥 괄호부터 접근 첫번째 위치부터 시작하여 ..

Python/Data Type 2022.04.25

[Python] Sequence Data Type - tuple

Sequence Data Type memership 연산: in 키워드 사용 size 함수: len(seq) slicing 속성: seq[:-1] iterability: 반복문에 있는 데이터를 순회할 수 있음 문자열, 튜플, 리스트, 바이트 배열, 바이트 등 5개의 내장 시퀀스 타입이 있음 tuple 쉼표(,)로 구분된 값을 괄호()을 이용해서 선언 괄호없이 튜플 선언 가능 한 개의 요소만 사용하여 튜플을 선언할 때에는 반드시 콤마(,)를 사용해야 함 삽입, 삭제, 수정 등이 불가능 tuple_1 = () tuple_2 = tuple() tuple_3 = (1, 2) tuple_4 = (3, ) tuple_5 = (4, 5, (6, 7)) tuple_6 = 8, 9, 10 t1 = 1234, "안녕!" ..

Python/Data Type 2022.04.25

데이터 분석

빅 데이터 분석 프로세스 Problem Definition 업무 이해 혹은 문제를 정의 Data Definition 데이터 이해 Design of Experiment / Sampling 실험 계획 수립 또는 표본화 Data Processing / Data Wrangling 데이터 가공 PDCA(Plan-Do-Check-Action) 주기에 따라 반복 EDA(Exploratory Data Analysis) / Data Visualization 탐색적 분석 데이터 시각화 CDA(Confirmatory Data Anaylysis) / Statistical Modeling 확증적 데이터 분석 통계적 모델링 혹은 모형화 지도 학습 모델 자율 학습 모델 Verification A/B 테스트 등 Data Wrangl..

[Python] Textract 문서 데이터 처리

Textract 워드, 파워포인트, PDF 파일 등의 텍스트 추출 https://github.com/deanmalmgren/textract GitHub - deanmalmgren/textract: extract text from any document. no muss. no fuss. extract text from any document. no muss. no fuss. Contribute to deanmalmgren/textract development by creating an account on GitHub. github.com Textract 설치 pip install textract Textract를 이용한 문서 데이터 추출 import textract text = textract.proces..

[Python] [tika-python] PDF, Powerpoint 정보 추출

tika-python [tika-pyhon @github] GitHub - chrismattmann/tika-python: Tika-Python is a Python binding to the Apache Tika™ REST services allowing Tika to be call Tika-Python is a Python binding to the Apache Tika™ REST services allowing Tika to be called natively in the Python community. - GitHub - chrismattmann/tika-python: Tika-Python is a Python binding ... github.com Apach Tika REST 서비스에 대한 Py..

[Python] [tabula-py] PDF 파일 정보 추출

tabula-py https://github.com/chezou/tabula-py GitHub - chezou/tabula-py: Simple wrapper of tabula-java: extract table from PDF into pandas DataFrame Simple wrapper of tabula-java: extract table from PDF into pandas DataFrame - GitHub - chezou/tabula-py: Simple wrapper of tabula-java: extract table from PDF into pandas DataFrame github.com tabula-py를 이용할 경우 PDF 파일 내의 테이블 정보를 pandas의 Dataframe으로 추..

[Python] [PyMuPDF] PDF 파일 정보 추출

PyMuPDF 설치 pip install PyMuPDF PyMuPDF를 이용한 파일 정보 추출 import fitz pdf_doc = fitz.open("sample.pdf") # number of pages print(f"전체 Page 수: {pdf_doc.page_count}") # Get the first page page = pdf_doc.load_page(0) # page 내의 텍스트 추출 print(page.get_text()) 결과 전체 Page 수:1 텍스트 상자: 슬라이드 내의 텍스트 데이터 추출 확인 테이블 컬럼1 테이블 컬럼2 테이블 컬러3 데이터1_1 데이터2_1 데이터3_1 데이터1_2 데이터2_2 데이터3_2 데이터1_3 데이터2_3 데이터3_3 ※ 한글 텍스트가 정상 추출됨을 ..

[Python] [PyPDF2] PDF 파일 정보 추출

PyPDF2 https://pythonhosted.org/PyPDF2/ PyPDF2 Documentation — PyPDF2 1.26.0 documentation pythonhosted.org PyPDF2 설치 pip install PyPDF2 PyPDF2를 이용한 파일 정보 추출 from PyPDF2 import PdfFileReader pdfreader = PdfFileReader("sample.pdf") # Document Information print(pdfreader.documentInfo) # Total page number print(f"Number of pages: {pdfreader.numPages}") # Get text from the first page print(pdfreader..

[Python] Python을 이용한 PDF 파일 정보 추출

PDF 파일 정보 추출을 위한 python 라이브러리들을 소개하고자 한다. PDF 파일에서 추출하고 싶은 데이터의 구조(텍스트, 테이블 데이터 등)나 Output 형태(이미지 파일, Dataframe 등)에 따라 적합한 라이브러리를 채택하여 데이터를 추출해야 한다. PyPDF2 ※ 한글 텍스트가 정상 추출되지 않는다. [Python/문서 데이터 분석] - PyPDF2 PyPDF2 PyPDF2 https://pythonhosted.org/PyPDF2/ PyPDF2 Documentation — PyPDF2 1.26.0 documentation pythonhosted.org PyPDF2 설치 pip install PyPDF2 PyPDF2를 이용한 파일 정보 추출 from PyPDF2 import PdfFile..

[Python] Python을 이용한 Powerpoint 파일 정보 추출 비교

Powerpoint 파일 정보 추출을 위한 python 라이브러리들을 소개하고자 한다. python-pptx [python-pptx] 파워포인트 문서 정보 추출 [python-pptx] Powerpoint 문서 정보 추출 python-pptx a Python library for creating and updating PowerPoint (.pptx) files 파워포인트(.pptx) 파일의 슬라이드 내 데이터를 추출하여 분석하고자 하는 경우 python-pptx를 활용할 수 있다. [python-pptx.. yumdata.tistory.com table, cell, row, column 등의 object 활용해서 텍스트 데이터 추출 가능 pptx 파일에만 사용 가능하고, ppt 파일은 사용할 수 없음 ..

[Python] [python-pptx] Powerpoint 문서 정보 추출

python-pptx a Python library for creating and updating PowerPoint (.pptx) files 파워포인트(.pptx) 파일의 슬라이드 내 데이터를 추출하여 분석하고자 하는 경우 python-pptx를 활용할 수 있다. [python-pptx document] python-pptx — python-pptx 0.6.21 documentation python-pptx.readthedocs.io [python-pptx @github] GitHub - scanny/python-pptx: Create Open XML PowerPoint documents in Python Create Open XML PowerPoint documents in Python. Contri..

[Web Crawling] Selenium

Selenium(셀레니움) 웹 브라우저의 자동화를 가능하게 하고 지원하는 다양한 도구와 라이브러리를 포함한 프로젝트 웹 앱을 테스트 할 때 주로 사용하는 프레임워크 webdriver라는 api를 통해서 browser 제어 동적인 환경에서 크롤링 웹 테스트의 자동화 www.selenium.dev/documentation/ko/ Selenium 브라우저 자동화 프로젝트 :: Selenium 문서 Selenium 브라우저 자동화 프로젝트 Selenium은 웹 브라우저의 자동화를 가능하게 하고 지원하는 다양한 도구와 라이브러리를 포함한 프로젝트입니다. 브라우저와의 사용자 간의 상호 작용을 테스 www.selenium.dev Selenium 라이브러리 설치 pip install selenium browser dr..

Python/Web Crawling 2021.05.11

[Pandas] apply 함수, applymap 함수, map 함수

apply 함수 커스텀 함수를 사용하기 위해 DataFrame에서 복수 개의 컬럼이 필요하다면, apply함수를 사용 열에 있는 모든 원소에 함수를 적용 Series에 적용할 경우 각 요소의 값이 적용된다. data = pd.DataFrame(np.random.randn(4,3), index=['one','two','three','four'], columns=['seoul','busan','gangju']) def gf(x): return pd.Series([x.mean(), x.std()], index=['mean','std']) data.apply(gf, axis=0) 매개 변수를 전달할 수도 있다. frame = pd.read_csv('titanic.csv') def f1(x, age=40): re..

Python/Pandas 2021.05.10

[Python] 파이썬 통계 분석

파이썬 통계 분석 개요 4차 산업혁명: 초연결, 지능, 융합 -> 사무인터넷, AI, 빅데이터 데이터 과학과(IoT + 빅데이터 + AI): 데이터 내재된 패턴 분석 -> 전략적 의미를 추론하는 방법 데이터의 분류 정형 데이터 일정한 규칙으로 체계적으로 정리된 것으로 그 자체로 해석이 가능하여 바로 활용할 수 있음 관계형 데이터베이스(DBMS) 반정형 데이터 고정된 필드에 저장되어 있지는 않지만 XML, HTML 등의 메타데이터와 스키마를 포함하는 것으로 파일 형태 저장 비정형 데이터 고정된 필드나 스키나가 없는 것 스마트 기기에서 페이스북, 트위터, 유튜브 등으로 생성되는 소셜 데이터 IoT 환경에서 생성되는 위치 정보나 센서 데이터와 같은 사물 데이터 등 데이터 분석 방법 분석 목적에 따른 구분 통계..

[Pandas] Pandas-Profiling

Pandas-Profiling 방대한 양의 데이터를 가진 데이터프레임을 .profile_report()라는 단 한 줄의 명령으로 탐색하는 패키지 Github github.com/pandas-profiling/pandas-profiling pandas-profiling/pandas-profiling Create HTML profiling reports from pandas DataFrame objects - pandas-profiling/pandas-profiling github.com Document pandas-profiling.github.io/pandas-profiling/docs/master/rtd/ Introduction — pandas-profiling 2.12.0 documentation D..

Python/Pandas 2021.04.12
728x90
반응형