[top][index]
search for:

number -- count how many elements of a list satisfy a condition

number(x,f) -- the number of elements e of the list x for which f(e) is true.

See also:

  • positions -- which elements of a list satisfy a condition
  • select -- select elements from a list or hash table
  • Code:

         -- ../../../Macaulay2/m2/lists.m2:38
         number = x -> # select x

    [top][index]
    search for: