Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » hash tables » mapping over hash tables » selectValues
next | previous | forward | backward | up | index | toc

selectValues -- select part of a hash table by values

Description

The hash table v should be immutable: to scan the values in a mutable hash table, use scan(values x, f).
i1 : x = new HashTable from { x => 1, y => 2, z => 3 }

o1 = HashTable{x => 1}
               y => 2
               z => 3

o1 : HashTable
i2 : select(x,odd)

o2 = HashTable{x => 1}
               z => 3

o2 : HashTable
i3 : select(1,x,odd)

o3 = HashTable{x => 1}

o3 : HashTable

See also

Ways to use selectValues:

  • selectValues(HashTable,Function)
  • selectValues(ZZ,HashTable,Function)

For the programmer

The object selectValues is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.25.06+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/select-doc.m2:159:0.