Skip to content

Instantly share code, notes, and snippets.

Avatar

Jinhwan Choi jinhwanlazy

View GitHub Profile
@jinhwanlazy
jinhwanlazy / SMQT.py
Created Mar 15, 2016
Successive Mean Quantization Transtform. Straightforward recursive implementation.
View SMQT.py
def SMQT(data, level):
ret = [0] * len(data)
def MQU(idx, depth):
if depth == 0 or not idx:
return
mean = sum(data[i] for i in idx) / len(idx)
D0, D1 = [], []
for i in idx:
(D0 if data[i] <= mean else D1).append(i)
@jinhwanlazy
jinhwanlazy / filter_algospot.py
Last active Aug 29, 2015
filter problems solved with python but not by me from algospot.com
View filter_algospot.py
import requests
from bs4 import BeautifulSoup as bs
from itertools import chain, filterfalse
langs = {'python': ['(py)', '(pypy)', '(py3)'],
'ruby': ['(rb)']}
def get_pids(maxpage=17):