This file contains hidden or 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
@register_jitable | |
def np_interp_impl_inner(x, xp, fp, dtype, non_finite_per_116): | |
# non_finite_per_116 -> if False, replicate the bug | |
# which existed in all versions to 1.16; if True, | |
# replicate numpy 1.16+ behaviour | |
x_arr = np.asarray(x) | |
xp_arr = np.asarray(xp) | |
fp_arr = np.asarray(fp) |
This file contains hidden or 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
@register_jitable | |
def np_interp_impl_inner(x, xp, fp, dtype): | |
x_arr = np.asarray(x) | |
xp_arr = np.asarray(xp) | |
fp_arr = np.asarray(fp) | |
if len(xp_arr) == 0: | |
raise ValueError('array of sample points is empty') | |
if len(xp_arr) != len(fp_arr): |
This file contains hidden or 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 __future__ import print_function | |
import sys | |
import timeit | |
import numpy as np | |
from numba import njit | |
np.random.seed(0) | |
ndata=20000 | |
# data to ne interpolated |
This file contains hidden or 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 pandas as pd | |
from numba import njit | |
import time | |
@njit | |
def ewma_version_1(x, halflife): | |
decay_coefficient = np.exp(np.log(0.5) / halflife) | |
out = np.empty_like(x, dtype=np.float64) |