lt_toolbox.TrajFrame.filter_isin#
- TrajFrame.filter_isin(var: str, values: list | Series, drop: bool = False) Self[source]#
Filter trajectories with at least one variable observation in a given sequence of values.
Filtering returns the complete trajectories of particles where one or more observations of the given variable are found in the given list or Series of values.
- Parameters:
var (str) – Name of variable contained in TrajFrame.
values (list | Series) – Values of variables used to filter trajectories.
drop (bool, default: False) – Determines if fitered trajectories should be returned as a new TrajFrame (False) or instead dropped from the existing TrajFrame (True).
- Returns:
TrajFrame including the complete Lagrangian trajectories which meet (do not meet) the specified filter condition.
- Return type:
TrajFrame
Examples
Filtering all trajectories with unique IDs in a given list:
>>> id_group = [1, 2, 3, 4, 5] >>> trajectories.filter_isin(var='id', values=id_group, drop=False)