Pyret has special functions that we can use to manipulate Tables.

  • In this course, the functions we’ll be using are

    • sort - consumes the name of a column and a Boolean value to determine if that table should be sorted by that column in ascending order

    • row-n - consumes an index (starting with zero!) and produces a row from a table

    • filter - consumes a Boolean-producing function, and produces a table containing only rows for which the function returns true

    • build-column - consumes the name of a new column, and a function that produces the values in that column for each Row

Order Matters! Table operations must be applied in the appropriate order. For example, trying to order a table by a column that hasn’t been built yet will result in an error.

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). CCbadge Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.