Transform simultaneously all columns of a tabular or a selection of them
Contributed by:
Daniele Gregori
Examples
Basic Examples (3)
Given a simple tabular with many columns:
We can simultaneously apply a mathematical function to all its elements:
Or change the colors of all cells with a given property:
Scope (6)
Suppose some data science work produced errors in the final Tabular (as many Round[Missing[]] cells):
To clean it, we can just apply replacement function to all its columns:
We can also specify a group of columns (as a Span or List) on which to apply a numeric operation (in the present case, we should exclude the Municipality column because it is made of strings):
Now on the cleaned table we can also perform an operation with ColumnwiseValue:
Or with ColumnwiseThread:
The columns specification can also be given as a list of column names of column indexes:
Properties and Relations (6)
TransformTabular[tab,f] is equivalent to TransformColumns with multiple function specifications. Define a Tabular:
We can apply a transformation for each column with TransformColumns:
Or apply it a single time with TransformTabular[f,tab]:
Check that the two results are equal:
When the function does not involve ColumnwiseValue or ColumnwiseThread, TransformTabular[tab,f] is equivalent to Query (with Normal):
Check that the two results are equal:
Publisher
Daniele Gregori
Version History
-
1.0.1
– 10 June 2026
-
1.0.0
– 14 May 2025
Related Resources
Author Notes
The development of this function benefitted from suggestions by the WFR Team.