base module¶
Generic Numba-compiled functions for base operations.
ol_bshift_1d_nb function¶
ol_bshift_nb function¶
ol_fshift_1d_nb function¶
ol_fshift_nb function¶
ol_nancumprod_nb function¶
ol_nancumsum_nb function¶
ol_nanprod_nb function¶
ol_nansum_nb function¶
ol_realign_1d_nb function¶
_realign_1d_nb(
arr,
source_index,
target_index,
source_freq,
target_freq,
source_rbound,
target_rbound,
nan_value,
ffill
)
ol_realign_nb function¶
_realign_nb(
arr,
source_index,
target_index,
source_freq,
target_freq,
source_rbound,
target_rbound,
nan_value,
ffill
)
ol_select_indices_1d_nb function¶
ol_select_indices_nb function¶
ol_set_by_mask_1d_nb function¶
ol_set_by_mask_mult_1d_nb function¶
ol_set_by_mask_mult_nb function¶
ol_set_by_mask_nb function¶
bfill_1d_nb function¶
Fill NaNs by propagating first valid observation backward.
Numba equivalent to pd.Series(arr).fillna(method='bfill').
Warning
This operation looks ahead.
bfill_nb function¶
2-dim version of bfill_1d_nb().
bshift_1d_nb function¶
Shift backward by n positions.
Numba equivalent to pd.Series(arr).shift(-n).
Warning
This operation looks ahead.
bshift_nb function¶
2-dim version of bshift_1d_nb().
crossed_above_1d_nb function¶
Get the crossover of the first array going above the second array.
If dropna is True, produces the same results as if all rows with at least one NaN were dropped.
crossed_above_nb function¶
2-dim version of crossed_above_1d_nb().
crossed_below_1d_nb function¶
Get the crossover of the first array going below the second array.
If dropna is True, produces the same results as if all rows with at least one NaN were dropped.
crossed_below_nb function¶
2-dim version of crossed_below_1d_nb().
demean_nb function¶
Demean each value within its group.
diff_1d_nb function¶
Compute the 1-th discrete difference.
Numba equivalent to pd.Series(arr).diff().
diff_nb function¶
2-dim version of diff_1d_nb().
fbfill_nb function¶
Forward and backward fill NaN values.
Note
If there are no NaN (or any) values, will return arr.
ffill_1d_nb function¶
Fill NaNs by propagating last valid observation forward.
Numba equivalent to pd.Series(arr).fillna(method='ffill').
ffill_nb function¶
2-dim version of ffill_1d_nb().
fillna_1d_nb function¶
Replace NaNs with value.
Numba equivalent to pd.Series(arr).fillna(value).
fillna_nb function¶
2-dim version of fillna_1d_nb().
fir_filter_1d_nb function¶
Filter data along one-dimension with an FIR filter.
first_valid_index_1d_nb function¶
Get the index of the first valid value.
first_valid_index_nb function¶
2-dim version of first_valid_index_1d_nb().
fshift_1d_nb function¶
Shift forward by n positions.
Numba equivalent to pd.Series(arr).shift(n).
fshift_nb function¶
2-dim version of fshift_1d_nb().
last_valid_index_1d_nb function¶
Get the index of the last valid value.
last_valid_index_nb function¶
2-dim version of last_valid_index_1d_nb().
nancnt_1d_nb function¶
Compute count while ignoring NaNs and not allocating any arrays.
nancnt_nb function¶
2-dim version of nancnt_1d_nb().
nancorr_1d_nb function¶
Numba equivalent of np.corrcoef that ignores NaN values.
Numerically stable.
nancorr_nb function¶
2-dim version of nancorr_1d_nb().
nancov_1d_nb function¶
Numba equivalent of np.cov that ignores NaN values.
nancov_nb function¶
2-dim version of nancov_1d_nb().
nancumprod_nb function¶
Numba equivalent of np.nancumprod along axis 0.
nancumsum_nb function¶
Numba equivalent of np.nancumsum along axis 0.
nanmax_nb function¶
Numba equivalent of np.nanmax along axis 0.
nanmean_nb function¶
Numba equivalent of np.nanmean along axis 0.
nanmedian_nb function¶
Numba equivalent of np.nanmedian along axis 0.
nanmin_nb function¶
Numba equivalent of np.nanmin along axis 0.
nanpartition_mean_noarr_1d_nb function¶
Average of np.partition that ignores NaN values and does not allocate any arrays.
Note
Has worst case time complexity of O(N^2), which makes it much slower than np.partition, but still faster if used in rolling calculations, especially for q near 0.
nanpercentile_noarr_1d_nb function¶
Numba equivalent of np.nanpercentile that does not allocate any arrays.
Note
Has worst case time complexity of O(N^2), which makes it much slower than np.nanpercentile, but still faster if used in rolling calculations, especially for q near 0 and 100.
nanprod_nb function¶
Numba equivalent of np.nanprod along axis 0.
nanstd_1d_nb function¶
Numba equivalent of np.nanstd.
nanstd_nb function¶
2-dim version of nanstd_1d_nb().
nansum_nb function¶
Numba equivalent of np.nansum along axis 0.
nanvar_1d_nb function¶
Numba equivalent of np.nanvar that does not allocate any arrays.
pct_change_1d_nb function¶
Compute the percentage change.
Numba equivalent to pd.Series(arr).pct_change().
pct_change_nb function¶
2-dim version of pct_change_1d_nb().
polyfit_1d_nb function¶
Compute the least squares polynomial fit.
rank_1d_nb function¶
Compute numerical data ranks.
Numba equivalent to pd.Series(arr).rank(pct=pct).
rank_nb function¶
2-dim version of rank_1d_nb().
realign_1d_nb function¶
realign_1d_nb(
arr,
source_index,
target_index,
source_freq=None,
target_freq=None,
source_rbound=False,
target_rbound=None,
nan_value=nan,
ffill=True
)
Get the latest in arr at each index in target_index based on source_index.
If source_rbound is True, then each element in source_index is effectively located at the right bound, which is the frequency or the next element (excluding) if the frequency is None. The same for target_rbound and target_index.
Note
Both index arrays must be increasing. Repeating values are allowed.
If arr contains bar data, both indexes must represent the opening time.
realign_nb function¶
realign_nb(
arr,
source_index,
target_index,
source_freq=None,
target_freq=None,
source_rbound=False,
target_rbound=False,
nan_value=nan,
ffill=True
)
2-dim version of realign_1d_nb().
repartition_nb function¶
Repartition a 2-dimensional array into a 1-dimensional by removing empty elements.
select_indices_1d_nb function¶
Set each element to a value by boolean mask.
select_indices_nb function¶
2-dim version of select_indices_1d_nb().
set_by_mask_1d_nb function¶
Set each element to a value by boolean mask.
set_by_mask_mult_1d_nb function¶
Set each element in one array to the corresponding element in another by boolean mask.
values must be of the same shape as in the array.
set_by_mask_mult_nb function¶
2-dim version of set_by_mask_mult_1d_nb().
set_by_mask_nb function¶
2-dim version of set_by_mask_1d_nb().
shuffle_1d_nb function¶
Shuffle each column in the array.
Specify seed to make output deterministic.
shuffle_nb function¶
2-dim version of shuffle_1d_nb().
to_renko_1d_nb function¶
Convert to Renko format.
to_renko_ohlc_1d_nb function¶
Convert to Renko OHLC format.
value_counts_1d_nb function¶
Compute value counts.
value_counts_nb function¶
Compute value counts per column/group.
value_counts_per_row_nb function¶
Compute value counts per row.