ColumnwiseThread

ColumnwiseThread[cbody]

denotes that cbody, a part of the body of a function, will be evaluated in columnwise form when using that function in TransformColumns or ConstructColumns operations.

Details

  • ColumnwiseThread is typically used as part of the Function body of the transformations performed on tabular data, to transform columnar data at once instead of row by row.
  • When transforming a Tabular object tab with Function[head[,ColumnwiseThread[cbody],]], cbody will be evaluated after replacing any instances of #col with the entire column tab[[All,col]]. If the result is another column of the same length, its values will be respectively used when the transformation acts row by row.

Examples

open allclose all

Basic Examples  (2)

Accumulate a column of a Tabular object and append the result as a new column:

Staring with a column, compute a new one by subtracting its reverse:

Scope  (1)

Use ColumnwiseThread to append a new column with standardized values of another column:

Properties & Relations  (2)

Use ColumnwiseThread to compute a vector-valued transformation of an entire column:

With ColumnwiseValue, you get the same list for each row:

Take a Tabular object:

TransformColumns by default operates sequentially on each row:

TransformColumns with ColumnwiseValue[expr] evaluates expr once first, then acts on each row:

TransformColumns with ColumnwiseThread[expr] evaluates expr once, acting on whole columns:

Wolfram Research (2025), ColumnwiseThread, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnwiseThread.html.

Text

Wolfram Research (2025), ColumnwiseThread, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnwiseThread.html.

CMS

Wolfram Language. 2025. "ColumnwiseThread." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColumnwiseThread.html.

APA

Wolfram Language. (2025). ColumnwiseThread. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColumnwiseThread.html

BibTeX

@misc{reference.wolfram_2024_columnwisethread, author="Wolfram Research", title="{ColumnwiseThread}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ColumnwiseThread.html}", note=[Accessed: 15-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_columnwisethread, organization={Wolfram Research}, title={ColumnwiseThread}, year={2025}, url={https://reference.wolfram.com/language/ref/ColumnwiseThread.html}, note=[Accessed: 15-January-2025 ]}