분류 전체보기
-
[PostgreSQL] WINDOW 함수: 누적합과 일반 합계 비교데이터 분석/SQL 2024. 7. 25. 17:39
윈도(WINDOW) 함수: 테이블의 행 집합에 대해 계산을 수행하여 각 행에 대한 결과를 반환하는 함수 예제CREATE TABLE example_table ( id SERIAL PRIMARY KEY, group_name TEXT, value INT);INSERT INTO example_table (group_name, value) VALUES('A', 10),('A', 20),('A', 30),('B', 5),('B', 15); 누적합을 계산하는 쿼리SELECT id, group_name, value, SUM(value) OVER (PARTITION BY group_name ORDER BY id) AS cumulative_sumFROM example_table;..
-
ERROR: cannot verify raw.githubusercontent.com's certificate, issued by ‘CN=DigiCert Global G2 TLS RSA SHA256 2020 CA1,O=DigiCert Inc,C=US’:트러블 슈팅 2024. 7. 11. 15:05
이 오류는 wget 명령어를 사용하여 raw.githubusercontent.com에서 파일을 다운로드하려 할 때, 인증서 검증 문제가 발생한 것을 나타낸다. 우선 간단하게 wget 명령어에 --no-check-certificate 옵션을 추가하여 SSL 인증서 검증을 건너뛸 수 있다.이 방법은 보안 위험이 있을 수 있으므로 신뢰할 수 있는 소스에서만 사용해야 한다. 수정 전!wget https://raw.githubusercontent.com/manifoldailearning/mlops-with-aws-datascientists/main/Section-13-Feature-Engineering/Dataset/bank-additional-full.csv 수정 후!wget --no-check-certific..
-
[웹 크롤링] 유튜브 랭킹 데이터 수집과 시각화데이터 분석/Python 2024. 7. 6. 21:56
from selenium import webdriver from selenium.webdriver.chrome.service import Servicefrom selenium.webdriver.chrome.options import Optionsfrom bs4 import BeautifulSoup import timeimport pandas as pd# Chromedriver 경로 설정chromedriver_path = '.\chromedriver.exe'# Service 객체 생성service = Service(chromedriver_path)# Options 객체 생성options = Options()# WebDriver 객체 생성browser = webdriver.Chrome(service=serv..
-
[웹 크롤링] 멜론 노래 순위 정보 크롤링데이터 분석/Python 2024. 7. 6. 21:40
구글 크롬 드라이버 설치https://googlechromelabs.github.io/chrome-for-testing/ Chrome for Testing availabilitychrome-headless-shellmac-arm64https://storage.googleapis.com/chrome-for-testing-public/126.0.6478.126/mac-arm64/chrome-headless-shell-mac-arm64.zip200googlechromelabs.github.io 크롬 드라이버 활용하기from selenium import webdriverfrom selenium.webdriver.chrome.service import Servicefrom selenium.webdriver.chr..
-
AttributeError: 'str' object has no attribute 'capabilities'트러블 슈팅 2024. 7. 6. 20:21
AttributeError: 'str' object has no attribute 'capabilities' 오류는 Selenium에서 크롬 웹드라이버를 설정하는 과정에서 발생최신 버전에서는 웹드라이버의 초기화 방법이 변경되었기 때문올바른 초기화 방법은 Service 객체를 사용하는 것 변경 전 코드from selenium import webdriverdriver = webdriver.Chrome('.\chromedriver.exe') 변경 후 코드from selenium import webdriverfrom selenium.webdriver.chrome.service import Servicefrom selenium.webdriver.chrome.options import Options# Chrome..
-
[pandas] 기초데이터 분석/Python 2024. 7. 6. 20:05
데이터 불러오기sample_1 = pd.read_excel('./files/sample_1.xlsx', # './'은 상대 경로를 의미 header=1, # 칼럼명이 있는 위치 skipfooter=2, # 마지막 로우에서 두 줄은 생략 usecols='A:C') # A 칼럼부터 C 칼럼까지 불러오기sample_1.info() # 데이터 정보 살펴보기sample_1.describe() # 데이터 기초통계량 확인 데이터 선택하기 - 로우(Row) 기준condition = (sample_1['성별'] == '남성..
-
CH 07. 비지도 학습데이터 분석/통계 2024. 7. 4. 17:35
주성분분석(PCA; Principal Components Analysis)- 흔히 변수들은 함께 변하기 때문에(공변), 어느 한 변수에서의 일부 변화는 실제로 다른 변수에서의 변화에 의해 중복되기도 한다(예를 들어 식당의 음식 값과 팁). 주성분분석은 수치형 변수가 어떤 식으로 공변하는지 알아내는 기법이다.- 전체 변수들의 변동성을 거의 대부분 설명할 수 있는 적은 수의 변수들의 집합을 주성분이라고 하며, 이를 이용해 데이터의 차원을 줄일 수 있다. 주성분을 만드는 데 사용되는 가중치는 결국 새로운 주성분을 만드는 데 기존의 변수들이 어느 정도 기여하는지를 보여준다. 주성분 계산- 주성분은 예측변수(수치형)들의 선형결합으로, 수치형 변수에 적용되며 범주형 변수에는 적용할 수 없다. 주성분 해석- 주성분들..
-
ExecutableNotFound: failed to execute WindowsPath('dot'), make sure the Graphviz executables are on your systems' PATH트러블 슈팅 2024. 7. 3. 12:53
https://graphviz.org/download/ DownloadSource Code Source code packages for the latest stable and development versions of Graphviz are available, along with instructions for anonymous access to the sources using Git. Executable Packages Packages marked with an asterisk(*) are provided by outsidgraphviz.org 운영체제에 맞는 EXE installer를 다운 받아서 실행시켜주면 된다.