faninsar.Loops#
- class faninsar.Loops(loops: list, sort: bool = True)[source]#
Bases:
objectLoops class to handle loops with multiple acquisitions.
Methods
__init__(loops[, sort])Initialize the loops class.
sort([ascending, inplace])Sort the loops.
to_matrix([dtype])Return a design matrix describes the relationship between loops and pairs.
Attributes
All diagonal pairs in the loops.
All edge pairs in the loops.
The loops in the numpy array format.
The names (str format) of the loops.
All pairs in the loops.
The shape of the loops array with format of (n_loops, n_pairs).
- to_matrix(dtype: DTypeLike = None) NDArray[np.number][source]#
Return a design matrix describes the relationship between loops and pairs.
The rows and columns of this matrix are loops and pairs respectively. The values of the matrix are 1 for the edge pairs, -1 for the diagonal pairs, and 0 otherwise.
- property loops: NDArray[np.object_]#
The loops in the numpy array format.
- property names: NDArray[np.str_]#
The names (str format) of the loops.