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 numpy as np | |
import numba as nb | |
import scipy.stats | |
@nb.njit(parallel=True) | |
def tiecorrect(rankvals): | |
""" | |
parallelized version of scipy.stats.tiecorrect |
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 concurrent.futures import ProcessPoolExecutor, as_completed | |
import cv2 | |
import multiprocessing | |
import os | |
import sys | |
def print_progress(iteration, total, prefix='', suffix='', decimals=3, bar_length=100): | |
""" | |
Call in a loop to create standard out progress bar |
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 numpy as np | |
from numba import jit | |
def levenshtein(x, y): | |
""" levenshtein distance for iterable sequences | |
""" | |
# check type | |
if (np.all(map(type, x)) is str) and (np.all(map(type, y)) is str): | |
_x = np.array(x, dtype=np.str) |