From 6a27d1ba2e81e2a039bcaa3c93525457123e9522 Mon Sep 17 00:00:00 2001 From: Filippo Pesavento Date: Wed, 27 Sep 2023 17:05:54 +0200 Subject: [PATCH] Add pick_inlaps() and pick_outlaps() functions --- fastf1/core.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fastf1/core.py b/fastf1/core.py index 814527889..e9039974e 100644 --- a/fastf1/core.py +++ b/fastf1/core.py @@ -2908,6 +2908,22 @@ def pick_wo_box(self) -> "Laps": """ return self[pd.isnull(self['PitInTime']) & pd.isnull(self['PitOutTime'])] + def pick_inlaps(self) -> "Laps": + """Return all laps which are in laps (driver entered the pit lane). + + Returns: + instance of :class:`Laps` + """ + return self[~pd.isnull(self['PitInTime'])] + + def pick_outlaps(self) -> "Laps": + """Return all laps which are out laps (driver exited the pit lane). + + Returns: + instance of :class:`Laps` + """ + return self[~pd.isnull(self['PitOutTime'])] + def pick_not_deleted(self) -> "Laps": """Return all laps whose lap times are NOT deleted.