combining module¶
Functions for combining arrays.
Combine functions combine two or more NumPy arrays using a custom function. The emphasis here is done upon stacking the results into one NumPy array - since vectorbt is all about brute-forcing large spaces of hyper-parameters, concatenating the results of each hyper-parameter combination into a single DataFrame is important. All functions are available in both Python and Numba-compiled form.
apply_and_concat function¶
apply_and_concat(
ntimes,
apply_func,
*args,
n_outputs=None,
jitted_loop=False,
jitted_warmup=False,
execute_kwargs=None,
**kwargs
)
Run apply_func function a number of times and concatenate the results depending upon how many array-like objects it generates.
apply_func must accept arguments i, *args, and **kwargs.
Set jitted_loop to True to use the JIT-compiled version.
All jitted iteration functions are resolved using JITRegistry.resolve().
Note
n_outputs must be set when jitted_loop is True.
Numba doesn't support variable keyword arguments.
apply_and_concat_each function¶
Apply each function on its own set of positional and keyword arguments.
Executes the function using execute().
apply_and_concat_multiple_nb function¶
Run apply_func_nb that returns multiple arrays number of times.
Uses custom_apply_and_concat_multiple_nb().
apply_and_concat_none_nb function¶
Run apply_func_nb that returns nothing number of times.
Uses custom_apply_and_concat_none_nb().
apply_and_concat_one_nb function¶
Run apply_func_nb that returns one array number of times.
Uses custom_apply_and_concat_one_nb().
combine_and_concat function¶
Combine obj with each in others using combine_func and concatenate.
select_and_combine_nb() is resolved using JITRegistry.resolve().
combine_and_concat_nb function¶
Numba-compiled version of combine_and_concat().
combine_multiple function¶
Combine objs pairwise into a single object.
Set jitted_loop to True to use the JIT-compiled version.
combine_multiple_nb() is resolved using JITRegistry.resolve().
Note
Numba doesn't support variable keyword arguments.
combine_multiple_nb function¶
Numba-compiled version of combine_multiple().
custom_apply_and_concat_multiple_nb function¶
Run apply_func_nb that returns multiple arrays for each index.
custom_apply_and_concat_none_nb function¶
Run apply_func_nb that returns nothing for each index.
Meant for in-place outputs.
custom_apply_and_concat_one_nb function¶
Run apply_func_nb that returns one array for each index.
select_and_combine function¶
Combine obj with an array at position i in others using combine_func.
select_and_combine_nb function¶
Numba-compiled version of select_and_combine().
to_2d_multiple_nb function¶
Expand the dimensions of each array in a along axis 1.
to_2d_one_nb function¶
Expand the dimensions of the array along the axis 1.