[AI SCHOOL 5기] 통계분석 실습 - 빈도 분석 & 기술통계량 분석

Chart Pie Chart 1 df['column'].value_counts().plot(kind = 'pie') Bar Chart 1 df['column'].value_counts().plot(kind = 'bar') Descriptive Statistics df['column'].max(): 최댓값 (행방향 기준: axis=1) df['column'].min(): 최솟값 df['column'].sum(): 합계 df['column'].mean(): 평균 df['column'].variance(): 분산 df['column'].std(): 표준편차 df['column'].describe(): 기술통계량 분포의 왜도와 첨도 df['column'].hist(): 히스토그램 df['column'].skew(): 왜도 (분포가 좌우로 치우쳐진 정도) 왜도(Skewness): 0에 가까울수록 정규분포 (절대값 기준 3 미초과) 우측으로 치우치면 음(negative)의 왜도, 좌측으로 치우치면 양(positive)의 왜도 df['column'].kurtosis(): 첨도 (분포가 뾰족한 정도) 첨도(Kurtosis): 1에 가까울수록 정규분포 (절대값 기준 8 또는 10 미초과) 왜도가 0, 정도가 1일 때 완전한 정규분포로 가정 sns....

April 2, 2022 · 2 min · 220 words · minyeamer

[AI SCHOOL 5기] 통계분석 실습 - Numpy & Pandas

Numpy Numpy Array 내부의 데이터는 하나의 자료형으로 통일 Numpy Array에 값을 곱하면 전체 데이터 그대로 복사되는 리스트와 달리 데이터에 각각 곱해짐 np.array([]): Numpy Array 생성 np.dtype: Numpy Array의 Data Type np.shape: Numpy Array 모양(차원) np.arange(): range를 바탕으로 Numpy Array 생성 np.reshape(): Numpy Array 모양을 변경, 열에 -1을 입력하면 자동 계산 np.dot(): 행렬곱 Pandas pd.Series([], index=[]): Key가 있는 리스트(Series) 생성 Series.values: Series의 값 Series.index: Series의 키 값 df.ammount: 띄어쓰기 없이 영단어로 구성된 열은 변수처럼 꺼내 쓸 수 있음 df....

March 29, 2022 · 1 min · 136 words · minyeamer

[AI SCHOOL 5기] 웹 크롤링 실습 - 웹 크롤링

Wadis 마감 상품 재고 체크 Google 메일 설정 1 2 3 4 5 6 7 8 9 10 11 12 import smtplib from email.mime.text import MIMEText def sendMail(sender, receiver, msg): smtp = smtplib.SMTP_SSL('smtp.gmail.com', 465) smtp.login(sender, 'your google app password') msg = MIMEText(msg) msg['Subject'] = 'Product is available!' smtp.sendmail(sender, receiver, msg.as_string()) smtp.quit() Wadis 상품 재고 체크 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 # 라이브러리 선언 check_status = 1 url = 'https://www....

March 29, 2022 · 3 min · 478 words · minyeamer

[AI SCHOOL 5기] 웹 크롤링 실습 - 셀레니움

Selenium 브라우저의 기능을 체크할 때 사용하는 도구 브라우저를 조종해야할 때도 사용 Import Libraries 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # 크롬 드라이버 파일 자동 다운로드 from webdriver_manager.chrome import ChromeDriverManager # 크롬 드라이버를 파일에 연결 from selenium.webdriver.chrome.service import Service from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from bs4 import BeautifulSoup import time import pandas as pd import warnings warnings....

March 28, 2022 · 3 min · 469 words · minyeamer

[AI SCHOOL 5기] 텍스트 분석 실습 - 워드클라우드

Okt Library 한국어 형태소 분석기 KoNLPy 패키지에 속한 라이브러리 KoNLPy 테스트 1 2 3 4 5 from konlpy.tag import Okt tokenizer = Okt() tokens = tokenizer.pos("아버지 가방에 들어가신다.", norm=True, stem=True) print(tokens) norm: 정규화(Normalization), ‘안녕하세욯’ -> ‘안녕하세요’ stem: 어근화(Stemming, Lemmatization), (‘한국어’, ‘Noun’) Pickle Library (Extra) 파이썬 변수를 pickle 파일로 저장/불러오기 1 2 3 4 5 with open('raw_pos_tagged.pkl', 'wb') as f: pickle.dump(raw_pos_tagged, f) with open('raw_pos_tagged.pkl','rb') as f: data = pickle.load(f) 크롤링 데이터 전처리 크롤링 데이터 불러오기 1 2 3 df = pd....

March 28, 2022 · 2 min · 349 words · minyeamer