safe_sort(values, codes=None, na_sentinel: 'int' = -1, assume_unique: 'bool' = False, verify: 'bool' = True) -> 'np.ndarray | tuple[np.ndarray, np.ndarray]'
values
should be unique if codes
is not None. Safe for use with mixed types (int, str), orders ints before strs.
Sequence; must be unique if codes
is not None.
Indices to values
. All out of bound indices are treated as "not found" and will be masked with na_sentinel
.
Value in codes
to mark "not found". Ignored when codes
is None.
When True, values
are assumed to be unique, which can speed up the calculation. Ignored when codes
is None.
Check if codes are out of bound for the values and put out of bound codes equal to na_sentinel. If verify=False
, it is assumed there are no out of bound codes. Ignored when codes
is None.
If values
is not list-like or if codes
is neither None
nor list-like * If values
cannot be sorted
If codes
is not None and values
contain duplicates.
Sorted values
Reordered codes
; returned when codes
is not None.
Sort values
and reorder corresponding codes
.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them