missionbio.mosaic.utils.get_indexes
missionbio.mosaic.utils.get_indexes#
- missionbio.mosaic.utils.get_indexes(from_list: Sequence, find_list: Sequence, order_using_find_list: bool = False) numpy.ndarray #
Find the intersection of arrays.
- Parameters
- from_listlist-like
The list for which indexes are to be found.
- find_listlist-like
The list containing values which are to be matched in from_list.
- order_using_find_listbool
If True, then the order in find-list is maintained otherwise the order in the from-list is maintained
- Returns
- indexes
Returns the indexes in from_list for values that are found in find_list.
Notes
get_indexes is much faster than np.where(np.isin(from_list, find_list)), but it uses more memory since it duplicates the data.