rowAt#

swordfish.function.rowAt()#
  • If Y is not specified, X must be a Boolean matrix or Boolean array vector. The rowAt function retrieves the row indices for each “true” element in X by row and returns an array vector (or columnar tuple) of integers. The returned result has the same number of rows as X. If X contains a row with only null values or “false” elements, rowAt returns null for that row.

  • If Y is a vector of integers, then each element in Y indicates the column index for X at each row. The rowAt function retrieves the corresponding element at each row in X and returns a vector of the same size as Y. If no element is found at the position specified by Y, a null value is returned. When Y is a Boolean matrix, X must be a matrix.

  • If Y is a Boolean matrix or Boolean array vector (or columnar tuple), the rowAt function retrieves the elements in X that correspond to the “true” values in Y and returns an array vector (or columnar tuple). The returned result has the same number of rows as Y. For any row in Y that contains only “false” elements, rowAt returns a null value in the output array vector for that row.

  • If Y is an array vector (or columnar tuple) of integers, then each row in Y indicates the column index for X at each row. The rowAt function retrieves the corresponding element(s) at each row in X and returns an array vector (or columnar tuple) of the same dimension as Y. If no element is found at the position specified by Y, a null value is returned.

Parameters:
  • X (Constant) – A matrix/array vector/columnar tuple.

  • Y (Constant, optional) – Can be a vector of integers, a Boolean matrix, a Boolean/integral array vector or columnar tuple.