I have two different dataframes:
The first dataframe stores some possible train connections (like a timetable):
index route start stop
0 1 a b
1 1 b c
2 1 c d
3 1 d e
4 2 g h
5 2 h i
6 2 i j
The second dataframe is a measurement of actual train stops:
index start stop passengers
0 a b 2
1 b d 4
2 a c 1
3 c d 2
4 g j 5
Sometimes the train does not stop at a station. What I try to achieve is to fill the missing stops and still keep track of the passenger measurement:
index route start stop passengers
0 1 a b 2
1 1 b c 4
2 1 c d 4
3 1 a b 1
4 1 b c 1
5 1 c d 2
6 2 g h 5
7 2 h i 5
8 2 i j 5
As a result I would just like to fill up all stops that have been skipped.