I have a data frame of dates in pandas and I want to filter it such that 'date_id' is between 'start_date' and 'end_date'
date_id start_date end_date
0 2010-06-04 2008-08-01 2008-09-26
1 2010-06-04 2008-08-01 2008-09-26
2 2010-06-04 2008-08-01 2008-09-26
3 2010-06-04 2008-08-26 2008-10-26
4 2010-06-04 2010-05-01 2010-09-26
5 2010-06-04 2008-08-01 2008-09-26
6 2010-06-04 2008-08-01 2008-09-26
7 2010-09-04 2010-08-01 2010-09-26
I've tried using the code below:
df[(df['date_id'] >= df['start_date'] & df['date_id']<= df['end_date')]
The code above results in a key error. I am a new pandas user so any assistance/documentation would be incredibly helpful.