segmentby#

swordfish.function.segmentby()#

segmentby is very similar to contextby except for how groups are determined. With contextby, a group includes all elements with the same value. With segmentby, only a block of equal value elements counts as a group. 2 blocks of equal value elements separated by different values are treated as 2 groups.

参数:
  • func (Constant) -- A function.

  • funcArgs (Constant) -- The parameters of func. It is a tuple if there are more than 1 parameter of func.

  • segment (Constant) -- The grouping variable.