I need a query to select records in a table based on the column data.
My table is like this
ID col1 col2
1. A. Bsp
2. B. Ees.
3. Ç. Eee
4 D Esp
5. E. Apt
6. F. Dpt
7. G. Bsp
8. H. Ees.
9. I. Eee
10 J Esp
11. K. Apt
I need a query to select the records after 'bsp' till 'esp'.
Like this,
ID col1 col2
2. B. Ees.
3. Ç. Eee
4 D Esp
8. H. Ees.
9. I. Eee
10 J Esp
Please consider a function that looks at col1 and col2 and returns a 1 or True to keep and 0 or False otherwise. Use that function create a column and the column to query the dataframe.