DataFrame.query

DataFrame.query(expr) DataFrame[source]

Query the columns of a DataFrame with a boolean expression.

TODO - add additional pandas arguments

Parameters

expr: str

A boolean expression

Returns

opensearch_py_ml.DataFrame:

DataFrame populated by results of the query

TODO - add link to opensearch_py_ml user guide

See Also

:pandas_api_docs:`pandas.DataFrame.query` :pandas_user_guide:`indexing`

Examples

>>> from tests import OPENSEARCH_TEST_CLIENT
>>> df = oml.DataFrame(OPENSEARCH_TEST_CLIENT, 'flights')
>>> df.shape
(13059, 27)
>>> df.query('FlightDelayMin > 60').shape
(2730, 27)