ColumnwiseValue
ColumnwiseValue[cbody]
denotes that cbody, a part of the body of a function, will be evaluated once in columnwise form before using that function to transform rows in TransformColumns or ConstructColumns operations.
Details
- ColumnwiseValue is typically used as part of the Function body of the transformations performed on tabular data, to precompute some partial results.
- When transforming a Tabular object tab with Function[head[…,ColumnwiseValue[cbody],…]], any instances of #col in cbody will be replaced with the entire column tab[[All,col]] and then evaluated to get the value cval. The transformation function becomes Function[head[…,cval,…]].
Examples
open allclose allBasic Examples (1)
Scope (2)
Use ColumnwiseValue to subtract the mean of a column from its values:
This is equivalent to first computing the mean value once and then subtracting it in every row:
Find which elements in a column are above the median:
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:
Text
Wolfram Research (2025), ColumnwiseValue, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnwiseValue.html.
CMS
Wolfram Language. 2025. "ColumnwiseValue." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColumnwiseValue.html.
APA
Wolfram Language. (2025). ColumnwiseValue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColumnwiseValue.html