Pandas: Apply function per row with context

April 12, 2023

def get_affected_days(start, finish):
    pass

pairs = df.apply(
    lambda row: get_affected_days(row['started_at'], row['finished_at']),
    axis=1
)