This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
from mytools import * | |
from mytools_other import * | |
import more_itertools_on_code as more_itertools | |
# | |
# | |
print( | |
'slide_each_simple (iterator)', | |
timeit.timeit( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
from mytools import * | |
# | |
# | |
print( | |
'slide_each_simple (iterator)', | |
timeit.timeit( | |
stmt='slide_each_simple(range(1000), 3)', | |
globals=globals() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import product, groupby | |
import operator | |
from UnionFind import UnionFind | |
def _renumber(id_list): | |
id_set = set(id_list) | |
replace_dict = dict(zip( | |
sorted(list(id_set)), | |
[i for i, _ in enumerate(id_set)] |
NewerOlder