ColumnwiseValue
✖
ColumnwiseValue
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)Summary of the most common use cases
Scope (2)Survey of the scope of standard use cases
Use ColumnwiseValue to subtract the mean of a column from its values:

https://wolfram.com/xid/0v5mv0udffube-sxnuzz


https://wolfram.com/xid/0v5mv0udffube-cg0m4r

This is equivalent to first computing the mean value once and then subtracting it in every row:

https://wolfram.com/xid/0v5mv0udffube-b8tieg


https://wolfram.com/xid/0v5mv0udffube-jcvhqu

Find which elements in a column are above the median:

https://wolfram.com/xid/0v5mv0udffube-gap13g

Include a constant column with the median value:

https://wolfram.com/xid/0v5mv0udffube-d5mt8y

Compute the median only once by using the operator form:

https://wolfram.com/xid/0v5mv0udffube-b3ac3u

Applications (1)Sample problems that can be solved with this function
Take a Tabular object of numbers:

https://wolfram.com/xid/0v5mv0udffube-45kiln

Standardize the "obs" column by acting on the column as a whole:

https://wolfram.com/xid/0v5mv0udffube-02lo8m

Properties & Relations (2)Properties of the function, and connections to other functions
Use ColumnwiseThread to compute a vector-valued transformation of an entire column:

https://wolfram.com/xid/0v5mv0udffube-ki8x4y

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

https://wolfram.com/xid/0v5mv0udffube-d1tcxw

Take a Tabular object:

https://wolfram.com/xid/0v5mv0udffube-bbmm5q

TransformColumns by default operates sequentially on each row:

https://wolfram.com/xid/0v5mv0udffube-8poffd







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

https://wolfram.com/xid/0v5mv0udffube-p36zm8





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

https://wolfram.com/xid/0v5mv0udffube-6b2fjx



Wolfram Research (2025), ColumnwiseValue, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnwiseValue.html.
Text
Wolfram Research (2025), ColumnwiseValue, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnwiseValue.html.
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.
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
Wolfram Language. (2025). ColumnwiseValue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColumnwiseValue.html
BibTeX
@misc{reference.wolfram_2025_columnwisevalue, author="Wolfram Research", title="{ColumnwiseValue}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ColumnwiseValue.html}", note=[Accessed: 19-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_columnwisevalue, organization={Wolfram Research}, title={ColumnwiseValue}, year={2025}, url={https://reference.wolfram.com/language/ref/ColumnwiseValue.html}, note=[Accessed: 19-June-2025
]}