파이썬(55)
-
DACON Python 튜토리얼 Lv2. 결측치 보간법과 랜덤포레스트로 따릉이 데이터 예측하기
데이터 다운로드 # 데이터 다운로드 링크로 데이터를 코랩에 불러옵니다. !wget 'https://bit.ly/3gLj0Q6' import zipfile with zipfile.ZipFile('3gLj0Q6', 'r') as existing_zip: existing_zip.extractall('data') --2023-01-12 03:54:03-- https://bit.ly/3gLj0Q6 Resolving bit.ly (bit.ly)... 67.199.248.10, 67.199.248.11 Connecting to bit.ly (bit.ly)|67.199.248.10|:443... connected. HTTP request sent, awaiting response... 301 Moved Permanen..
2023.01.12 -
DACON Python 튜토리얼 Lv1. 의사결정회귀나무로 따릉이 데이터 예측하기
데이터 다운로드 # 데이터 다운로드 링크로 데이터를 코랩에 불러옵니다. !wget 'https://bit.ly/3gLj0Q6' import zipfile with zipfile.ZipFile('3gLj0Q6', 'r') as existing_zip: existing_zip.extractall('data') --2023-01-11 08:15:16-- https://bit.ly/3gLj0Q6 Resolving bit.ly (bit.ly)... 67.199.248.11, 67.199.248.10 Connecting to bit.ly (bit.ly)|67.199.248.11|:443... connected. HTTP request sent, awaiting response... 301 Moved Permanen..
2023.01.11 -
데이터 과학 기반의 파이썬 빅데이터 분석 Chapter10 회귀 분석
01 [선형 회귀 분석 + 산점도/선형 회귀 그래프] 환경에 따른 주택 가격 예측하기 !pip install sklearn Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Collecting sklearn Downloading sklearn-0.0.post1.tar.gz (3.6 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: sklearn Building wheel for sklearn (setup.py) ... done Created wheel for sklearn: file..
2023.01.09 -
데이터 과학 기반의 파이썬 빅데이터 분석 Chapter09 지리 정보 분석
01 [주소 데이터 분석 + 지오맵] 지리 정보 분석 후 맵 생성하기 import pandas as pd CB = pd.read_csv('CoffeeBean.csv', encoding = 'CP949', index_col = 0, header = 0, engine = 'python') CB.head() #작업 내용 확인용 출력 addr = [] for address in CB.address: addr.append(str(address).split()) addr #작업 내용 확인용 출력 [['서울시', '강남구', '학동로', '211', '1층'], ['서울시', '강남구', '광평로', '280', '수서동', '724호'], ['서울시', '강남구', '논현로', '566', '강남차병원1층'], [..
2023.01.09 -
데이터 과학 기반의 파이썬 빅데이터 분석 Chapter06 파이썬 크롤링 - 라이브러리 이용
정적 웹 페이지 크롤링 준비 1.1 BeautifulSoup 연습하기 1 from bs4 import BeautifulSoup 연습용 html 작성 html = '한빛출판네트워크로그인한빛미디어한빛아카데미' BeutifulSoup 객체 생성 soup = BeautifulSoup(html, 'html.parser') 객체에 저장된 html 내용 확인 print(soup.prettify()) 한빛출판네트워크 로그인 한빛미디어 한빛아카데미 1.2 BeautifulSoup 연습하기 2 태그 파싱하기: 지정된 한 개의 태그만 파싱 한다. soup.h1 한빛출판네트워크 tag_h1 = soup.h1 tag_h1 한빛출판네트워크 tag_div = soup.div tag_div 로그인한빛미디어ul.brand>li") l..
2023.01.06 -
데이터 과학 기반의 파이썬 빅데이터 분석 Chapter05 파이썬 크롤링-API 이용
01. 네이버 API를 이용한 크롤링 [CODE 0] 먼저, 전체 작업 스토리를 설계한다. def main(): node = 'news' #크롤링할 대상 srcText = input('검색어를 입력하세요: ') cnt = 0 jsonResult = [] jsonResponse = getNaverSearch(node, srcText, 1, 100) #[CODE 2] total = jsonResponse['total'] while ((jsonResponse != None) and (jsonResponse['display'] != 0)): for post in jsonResponse['items']: cnt += 1 getPostData(post, jsonResult, cnt) #[CODE 3] start =..
2023.01.05