Resample financial data to a specified frequency using a Numba-compiled
function.This function utilizes Numba’s Just-in-Time (JIT) compilation to optimize
performance for resampling time series data, keeping the last value within
each resampling period.Parameters:
Name
Type
Default
Description
close
tp.Array2d
--
A 2-dimensional array of asset closing prices, where rows represent time and columns represent assets.
index
tp.Array1d
--
A 1-dimensional array of datetime values corresponding to the time index of close.
freq
np.timedelta64
--
A Numpy timedelta64 object representing the desired frequency for resampling. For example, np.timedelta64(1, 'D') for daily data, np.timedelta64(1, 'W') for weekly, etc.
Returns:
Type
Description
tp.Array2d
A 2-dimensional array of resampled closing prices, with rows corresponding to the resampled time periods and columns to the assets.