본문 바로가기
반응형
글쓰기

Python11

[python] 셀레늄 우회 로컬에서 크롬 실행 (자동화된 테스트 소프트웨어에 의해 제어) 셀레늄 우회, 로컬에서 크롬 실행크롬 옵션을 사용하여 셀레늄 자동화 탐지 우회하기 아래 코드 중, 아무거나 되는거 사용하면 될 듯 1. 크롬 자동화 탐지 방지 옵션# 모듈 불러오기from selenium.webdriver.chrome.options import Optionsoption = Options()option.add_experimental_option("detach", True)# 자동화 탐지 방지option.add_argument("disable-blink-features=AutomationControlled") # 자동화 표시 제거option.add_experimental_option("excludeSwitches", ["enable-automation"])# 자동화 확장 기능 사용 안.. 2025. 6. 4.
[python] 주파수 신호 분석 방법론 3 - Wavelet 변환 python Wavelet Transformwavelet 데이터를 밴드별로 분할시켜서 증폭시킴window length를 바꿔가며 STFT를 여러번 진행하는 개념복잡한 주파수 특성을 가진 신호에 대해 다해상도 분석을 통해 주파수에 관한 정보 획득 → 시간 분해능과 주파수 분해능을 모두 고려 (Wevelet Mother Function을 변화시켜 주파수 해상도나 시간 해상도를 조절) 장점FTF보다 적용범위가 넓음특징요소 추출 자동화 용이전처리 및 특징요소 추출 동시 수행다수 신호에 대한 일괄적인 데이터 가공에 유리 단점데이터 크기에 따라 추출 결과 변함추출되는 특징요소 종류 많음 python 코드모듈 importimport pandas as pdimport numpy as npimport scipy... 2024. 11. 26.
[python] 주파수 신호 분석 방법론 2 - STFT (Short Time Fourier Transform) STFT (Short Time Fourier Transform)짧은 시간별로 FFT를 수행하여, 일정한 단위시간별 주파수 밀도를 스펙트로그램으로 표현→ 시간에 따른 주파수 변화 확인 가능 시간해상도와 주파수해상도를 일정하게 유지 → Window Function 에 의해 고정 코드라이브러리 importmport pandas as pdimport numpy as npimport matplotlib.pyplot as pltfrom scipy import signal #science python : scipyimport math 주파수 f, 각주파수 w 정의# 주파수 입력f1 = 2 f2 = 8f3 = 4f4 = 6f5 = 10# w = 2pi*fw1 = 2*np.pi*f1 w2 = 2*np.pi*f.. 2024. 11. 25.
[python] 주파수 신호 분석 방법론 1 - FFT (Fast Fourier Transform) FFT (Fast Fourier Transform): 신호를 다양한 주파수를 갖는 주기함수들로 변환하여, 신호에 대한 주파수 정보제공 Sin, Cos 함수로 주기/진폭이 변형된 다양한 주기함수를 탐색 후, 주파수 기준으로 재배열주로 진동 데이터의 특성 주파수를 찾아내기 위해서 사용주파수에 대한 정보만 파악하기 때문에, 시간에 대한 정보는 알 수 없음 * 주기와 주파수의 관계frequency (주파수/진동수) : 단위시간 동안 진동한 횟수T (주기) : 한 번 진동할 때 걸리는 시간 장점주파수에 따른 분석 용이기계적 원인 분석 용이단점특정 데이터 형태에서 오차 발생주파수 영역별 필터 최적화 필요 코드라이브러리 imoprtimport pandas as pdimport numpy as npimport ma.. 2024. 11. 24.
[python] 난수 생성하기 random의 모든 것 random 모듈을 이용하여 난수 생성하기 module importimport random random.random( )# 0이상 1미만의 실수random.random()→ 0.28483 random.randrange( start , stop [ , step] ) *정수만 생성# 1이상 7미만의 정수random.randrange(1, 7) # 1이상 10미만, 간격 2random.randrange(1, 10, 2)→ [1, 3, 5, 7, 9] 중 하나 random.randint( Start, End )# start 이상 end 이하의 정수 생성random.randint( 1, 3 )→ 1~3 중 하나 random.uniform( a, b ) *실수 생성# 1이상 2이하 실수 생성rand.. 2024. 9. 22.
[python] Selenium 활용 예스24 티켓예매 매크로 만들기 Selenium 활용 Yes24 티켓 예매 매크로 만들기(*selenium 연습용으로 사용할 것) 1. 패키지 설치pip install selenium 2. 모듈 importfrom selenium import webdriverfrom selenium.webdriver.common.keys import Keysfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.chrome.options import Optionsfrom selenium.webdriver.support.ui import Selectimport time 3. 웹 드라이버 설정 웹드라이버를 설정해준 뒤, yes24 티켓예매 페이지를 받아온다# 브라우저 꺼짐 방지 옵션ch.. 2024. 5. 28.
[python] 파이썬 클래스 개념 (__init__, self) 클래스 (Class): 동작(behavior, method, function)과 상태(state, attribute, variable)의 묶음   → 객체를 찍어내기 위한 설계도  클래스 만들기# 클래스class Person : def setdata(self, name, age): self.name = name self.age = age         # 객체 생성 p1 = Person() p1.setdata('spectrum',20)  클래스에 메소드 추가하기class Person : def setdata(self, name, age): self.name = name self.age = age         def walk(self): print('뚜벅뚜벅') def talk(self).. 2024. 5. 19.
[python] Selenium IE 에서 시작하기 (+Internet Explore) IE에서 Seleniu을 시작해보자 (그만해보자... 오랜만에 코드를 실행해보니, 작동이 안됨)  먼저, IE 드라이버 설치https://www.selenium.dev/downloads/ DownloadsSelenium automates browsers. That's it!www.selenium.dev다운로드 후, 압축을 풀어준다   코드from selenium import webdriverfrom selenium.webdriver.ie import serviceimport timegoogle= 'https://www.google.com'ie_options = webdriver.IeOptions()ie_options.ignore_protected_momde_settings = Trues=service.S.. 2023. 11. 4.
[python] Selenium chrome에서 시작하기 (+ 크롬 브라우저, element, driver, alert 다루기) Selenium 프레임워크 활용 자동화 매크로를 만들어보았다  ***  Selenium 4버전 이상에서는 크롬 드라이버를 따로 설치하지 않아도 된다!크롬드라이버 설치크롬 브라우저를 사용할거라 내 컴퓨터의 크롬 버전에 맞는 크롬드라이버를 설치해준다크롬 버전 확인은 크롬브라우저 창 오른쪽 맨 끝 점 세 개 → 도움말 → Chrome 정보에 들어가서 확인할 수 있다 아래 사이트에서 내 크롬브라우저 버전에 맞는 크롬드라이버를 설치한다https://chromedriver.chromium.org/downloads ChromeDriver - WebDriver for Chrome - DownloadsCurrent Releases If you are using Chrome version 115 or newer, plea.. 2023. 10. 15.
반응형