equals
The equals (=
) match filter returns rows that are an exact match to the specified value.
Syntax
columnName = value
columnName == value
columnName
- the column the filter will search for the matching value.value
- the value to match on.
Examples
The following example returns rows where Color
is blue
.
from deephaven import new_table
from deephaven.column import string_col, int_col
from deephaven.constants import NULL_INT
source = new_table(
[
string_col("Letter", ["A", "C", "F", "B", "E", "D", "A"]),
int_col("Number", [NULL_INT, 2, 1, NULL_INT, 4, 5, 3]),
string_col(
"Color", ["red", "blue", "orange", "purple", "yellow", "pink", "blue"]
),
int_col("Code", [12, 14, 11, NULL_INT, 16, 14, NULL_INT]),
]
)
result = source.where(filters=["Color = `blue`"])
- source
- result
The following example returns rows where Color
is blue
and Code
is 14.
from deephaven import new_table
from deephaven.column import string_col, int_col
from deephaven.constants import NULL_INT
source = new_table(
[
string_col("Letter", ["A", "C", "F", "B", "E", "D", "A"]),
int_col("Number", [NULL_INT, 2, 1, NULL_INT, 4, 5, 3]),
string_col(
"Color", ["red", "blue", "orange", "purple", "yellow", "pink", "blue"]
),
int_col("Code", [12, 14, 11, NULL_INT, 16, 14, NULL_INT]),
]
)
result = source.where(filters=["Color = `blue`", "Code = 14"])
- source
- result
The following example returns rows where Color
is blue
or Code
is 14.
from deephaven import new_table
from deephaven.column import string_col, int_col
from deephaven.constants import NULL_INT
source = new_table(
[
string_col("Letter", ["A", "C", "F", "B", "E", "D", "A"]),
int_col("Number", [NULL_INT, 2, 1, NULL_INT, 4, 5, 3]),
string_col(
"Color", ["red", "blue", "orange", "purple", "yellow", "pink", "blue"]
),
int_col("Code", [12, 14, 11, NULL_INT, 16, 14, NULL_INT]),
]
)
result = source.where_one_of(filters=["Color = `blue`", "Code = 14"])
- source
- result