siml.siml_variables.array_variables package¶
Submodules¶
siml.siml_variables.array_variables.interface_wrapper module¶
- class siml.siml_variables.array_variables.interface_wrapper.ISimlArray(data: T)¶
Bases:
object
- abstract apply(function: Callable[[T], T], componentwise: bool, *, skip_nan: bool = False, use_diagonal: bool = False, **kwards) T ¶
Apply user defined function
- Parameters:
function (Callable[[T], T]) – function to apply
componentwise (bool) – If True, fucnction is applied by component wise way
skip_nan (bool, optional) –
- If True, np.nan value is ignored. This option is valid
only when data is np.ndarray. By default False
use_diagonal (bool, optional) –
- If True, only diagonal values are used. This option is valid
only when data is sparse array. By default False
- Returns:
T
- Return type:
Same type of instance caraible
- abstract reshape(componentwise: bool, *, skip_nan: bool = False, use_diagonal: bool = False, **kwrds) T ¶
- abstract property shape: tuple[int]¶
siml.siml_variables.array_variables.ndarray_wrapper module¶
- class siml.siml_variables.array_variables.ndarray_wrapper.NdArrayWrapper(data: ndarray)¶
Bases:
ISimlArray
- apply(function: Callable[[ndarray], ndarray], componentwise: bool, *, skip_nan: bool = False, **kwards) ndarray ¶
Apply user defined function
- Parameters:
function (Callable[[T], T]) – function to apply
componentwise (bool) – If True, fucnction is applied by component wise way
skip_nan (bool, optional) –
- If True, np.nan value is ignored. This option is valid
only when data is np.ndarray. By default False
use_diagonal (bool, optional) –
- If True, only diagonal values are used. This option is valid
only when data is sparse array. By default False
- Returns:
T
- Return type:
Same type of instance caraible
- reshape(componentwise: bool, *, skip_nan: bool = False, **kwards) ndarray ¶
- property shape: tuple[int]¶
siml.siml_variables.array_variables.sparce_array_wrapper module¶
- class siml.siml_variables.array_variables.sparce_array_wrapper.SparseArrayWrapper(data: coo_matrix | csr_matrix | csc_matrix)¶
Bases:
ISimlArray
- apply(apply_function: Callable[[coo_matrix | csr_matrix | csc_matrix], coo_matrix | csr_matrix | csc_matrix], componentwise: bool, *, use_diagonal: bool = False, **kwards) coo_matrix | csr_matrix | csc_matrix ¶
Apply user defined function
- Parameters:
function (Callable[[T], T]) – function to apply
componentwise (bool) – If True, fucnction is applied by component wise way
skip_nan (bool, optional) –
- If True, np.nan value is ignored. This option is valid
only when data is np.ndarray. By default False
use_diagonal (bool, optional) –
- If True, only diagonal values are used. This option is valid
only when data is sparse array. By default False
- Returns:
T
- Return type:
Same type of instance caraible
- reshape(componentwise: bool, *, use_diagonal: bool = False, **kwards) coo_matrix | csr_matrix | csc_matrix ¶
- property shape: tuple[int]¶
Module contents¶
- siml.siml_variables.array_variables.create_siml_arrray(data: ndarray | coo_matrix | csr_matrix | csc_matrix) ISimlArray ¶