0

I have a data frame with two date columns and am needing to pass both of those dates through a function to see if they are in a certain date range.

It would need to be something like:

df['new_column'] = if df['column1'].between(date_1, date_2, inclusive=True) and df['column2] > date_2 = 'True', else 'False'

  • You need to use `&`/`|` as vectorial `and`/`or`: `df['new_column'] = df['column1'].between(date_1, date_2, inclusive=True) & (df['column2] > date_2)` – mozway Apr 04 '22 at 20:20

0 Answers0