tbplas.split_list

tbplas.split_list(raw_list: List[Any], num_group: int, algorithm: str = 'remainder') List[List[Any]]

Split given list into different groups.

Two algorithms are implemented: by the remainder of the index of each element divided by the number of group, or the range of index. For example, if we are to split the list of [0, 1, 2, 3] into two groups, by remainder we will get [[0, 2], [1, 3]] while by range we will get [[0, 1], [2, 3]].

Parameters:
  • raw_list – incoming list to split

  • num_group – number of groups

  • algorithm – algorithm for grouping elements, should be either “remainder” or “range”

Returns:

split list from raw_list