eelbrain.Var.count

Var.count(value=None, start=-1)

Count the number of occurrence of each value

Parameters:
  • value (float) – Value which is to be counted.

  • start (int) – Value at which to start counting (with the default of -1, the first occurrence will be 0).

Return type:

Var

Examples

>>> v = Var([1, 2, 3, 1, 1, 1, 3])
>>> v.count()
Var([0, 0, 0, 1, 2, 3, 1])
>>> v.count(3)
Var([0, 0, 1, 1, 1, 1, 2])