format_column_where
The format_column_where
method applies color formatting to a column of the source table, based on user-specified conditions.
Syntax
table.format_column_where(col: str, cond: str, formula: str) -> Table
Parameters
Parameter | Type | Description |
---|---|---|
col | str | The column name. |
cond | str | The condition expression. |
formula | str | Formulas to compute formats for columns or rows in the table; e.g., For decimal formats, the result must be a string, and the formula must be wrapped in the special internal
function |
Returns
A new table that applies the specified formatting to the source table.
Examples
In the following example, we use format_column_where
to paint the "X" column red where the value is greater than 2.
from deephaven import time_table
tt = time_table("PT1S").update("X = ii")
result = tt.format_column_where(col="X", cond="X > 2", formula="RED")
- result
- tt