map_negative_indices
No overview available.
def map_negative_indices(
indices: list,
length: int
) - > list
Converts negative index values into their positive equivalents based on the total length of a sequence.
Parameters
| Name | Type | Description |
|---|---|---|
| indices | list | A list of integers representing sequence positions, which may include negative values for end-relative indexing. |
| length | int | The total number of elements in the target sequence used to calculate positive offsets. |
Returns
| Type | Description |
|---|---|
list | A list of non-negative integers where negative inputs have been offset by the sequence length. |