query#

NestSeriesAccessor.query(query: str) NestedSeries[source]#

Query the flat arrays with a boolean expression

Currently, it will remove empty rows from the output series. # TODO: preserve the index keeping empty rows

Parameters:

query (str) – Boolean expression to filter the rows.

Returns:

The filtered series.

Return type:

NestedSeries

Examples

>>> from nested_pandas.datasets.generation import generate_data
>>> nf = generate_data(5, 5, seed=1)
>>> nf["nested"].nest.query("flux > 50")
0    [{t: 13.40935, flux: 98.886109, flux_error: 1....
1    [{t: 13.70439, flux: 68.650093, flux_error: 1....
2    [{t: 4.089045, flux: 83.462567, flux_error: 1....
3    [{t: 2.807739, flux: 78.927933, flux_error: 1....
4    [{t: 0.547752, flux: 75.014431, flux_error: 1....
dtype: nested<t: [double], flux: [double], flux_error: [double], band: [string]>