I have a dataset as follow:
task = ['duty of care','informed consent','records management','conducting','experiments','positive reinforcement','developing','rapport' ]
start = [ 21, 24, 26, 60, 61, 80,98,99 ]
end = [ 24, 26, 28, 61, 62, 82,99,100]
dat = pd.DataFrame({'task': task, 'start':start, 'end': end})
dat
What I want to accomplish is this
- if
dat.end[i] == dat.start[i+1]then aggregatedat.task - if
dat.end[i] != dat.start[i+1]do nothing
The desired output should look like this.

