find#

swordfish.function.find()#

If X is a vector: for each element of Y, return the position of its first occurrence in vector X. If the element doesn’t appear in X, return -1. (To find the positions of all occurences, please use function at.)

If X is a dictionary: for each element of Y, if it is a key in X, return the corresponding value in X; if it is not a key in X, return NULL.

If X is an in-memory table with one column: for each element of Y, return the position of its first occurrence in the column of X. If the element doesn’t appear in X, return -1. Note the column cannot be of array vector form.

If X is a keyed table or indexed table: for each element of Y, return the position of its first occurrence in the key columns of X. If the element doesn’t appear in the key columns of X, return -1.

Parameters:
  • X (Constant) – A vector, dictionary, in-memory table with one column, keyed table, or indexed table.

  • Y (Constant) – A scalar, vector, matrix, tuple, dictionary, or table.