eta.util.general.split_by_cond

split_by_cond(lst, cndfn)[source]

Split a list by a given condition function.

Parameters:
  • lst (list) –

  • cndfn (function) –

Returns:

  • filtered (list) – The input list with elements matching cndfn filtered out.

  • matching (list) – A list of elements from the input list matching cndfn.