Skip to content

Instantly share code, notes, and snippets.

View tyjeon24's full-sized avatar

Taeyong Jeon tyjeon24

View GitHub Profile
@tyjeon24
tyjeon24 / pandas_style_convention.ipynb
Last active May 23, 2023 14:16
Pandas code convention. Pandas 코드를 가독성 있게 작성해보세요.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tyjeon24
tyjeon24 / sklearn_pca_quickstarter.ipynb
Created May 23, 2023 14:09
Quickstarter code for using PCA.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tyjeon24
tyjeon24 / torch_regressor_cheatsheet.ipynb
Created May 20, 2023 08:24
Understanding pyTorch regression model quickly.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tyjeon24
tyjeon24 / manager.py
Last active June 7, 2021 14:32
리스트 안의 것들을 multiprocessing으로 처리해서 저장해주는 기능.
import multiprocessing
import time
def square(result, x):
result.append(x*x)
if __name__ == "__main__":
# 1. Prepare multiprocessing
pool = multiprocessing.Pool(8)
m = multiprocessing.Manager()
modifier = {
factor = 0
OR = {
has_designation = col_capital # 수도는 자동화 예외.
has_designation = col_rural # 지방 행성은 자동화를 원하지 않는 행성 전용.
}
}
@tyjeon24
tyjeon24 / linear_programming.md
Last active April 4, 2020 02:00
Python : cvxpy linear programming
  • https://datascienceschool.net/view-notebook/0fca28c71c13460fb7168ee2adb9a8be/
  • 최소값 : 제품 A와 제품 B 각각 100개 이상 생산해야 한다.
  • 시간 : 시간은 500시간 밖에 없다. 제품 A는 생산하는데 1시간이 걸리고 제품 B는 2시간이 걸린다.
  • 부품 : 특정 부품이 9800개밖에 없다. 제품 A는 생산하는데 특정 부품을 4개 필요로 하고 제품 B는 생산하는데 특정 부품을 5개 필요로 한다.
  • 이익 : 제품 A의 이익은 하나당 3만원이고 제품 B의 이익은 하나당 5만원이다.
  • ==> 이때, 이익을 최대화하기 위한 각 생산량 x1, x2의 값을 구한다.
pip3 install cvxpy
@tyjeon24
tyjeon24 / class_basic.py
Created April 2, 2020 15:14
Python : class basic
class ClassName:
def __init__(self, value):
self.value = value
def setName(self):
pass
@tyjeon24
tyjeon24 / naver_shopping_api.py
Created April 2, 2020 14:01
Python : Naver shopping API
import json
import requests
SHOPPING_API_BASE_URL = "https://openapi.naver.com/v1/search/shop.json"
X_Naver_Client_Id = "9812tzgAqMDNLRNb_wsq"
X_Naver_Client_Secret = "iqlSwCt6ee"
SHOPPING_API_HEADER = {"X-Naver-Client-Id":X_Naver_Client_Id,"X-Naver-Client-Secret":X_Naver_Client_Secret}
def main():
keywords = "이어폰"
@tyjeon24
tyjeon24 / naver_ad_api.py
Last active July 8, 2020 15:10
Python : Naver Ad API
import base64
import hashlib
import hmac
import json
import requests
import time
def main():
BASE_URL = "https://api.naver.com" # 네이버 광고 API의 기본 URL이다.
uri = "/keywordstool"
@tyjeon24
tyjeon24 / selenium_with_tor
Created March 14, 2020 03:22
Python:Selenium with Tor
# Before running the code
# 1. Tor service should one service or tor.exe is running.
from selenium import webdriver
PROXY = "socks5://localhost:9050"
options = webdriver.ChromeOptions()
options.add_argument('--proxy-server=%s' % PROXY)
driver = webdriver.Chrome(options=options, executable_path=r'chromedriver.exe')