Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

thread function

Apply a function to corresponding elements of lists.

How to write it

thread(call)

call
A call whose arguments are lists of the same length. Takes an expression.

Examples

  • thread⁡(f([1,2],[3,4]))=[f(1,3),f(2,4)]\displaystyle \operatorname{thread}(f(\left[ 1, 2 \right], \left[ 3, 4 \right])) = \left[ f(1, 3), f(2, 4) \right]
    thread(f([1, 2], [3, 4]))

    In the solver, thread(f([1, 2], [3, 4])) gives [f(1, 3), f(2, 4)].

    Open in the solver
  • map_thread

    Apply a function to corresponding elements of several lists.

  • total

    Sum of the elements of a list.

  • tally

    How often each element occurs: a list of element and count pairs.

  • union

    The elements in any of some lists, each once, in order.

  • take

    The first elements of a list.

  • accumulate

    Running totals of a list.