I have this sequence:
And the result that I expect is:
It should be finished with the last row with: 5816993 - 0 I have 3 different dataframes where I shoud apply the same order, the only thing that I know is the finish of the sequence [5816993 - 0]
Dataframe:
df_1['IN'] = [5797067,5801307,5801615,5802487,5802839,5803163,5803579,5804175,5804947,5805287,5805559,5816775,5816957,5816993,5817055]
df_1['OUT'] = [5801307, 5801615, 5802487, 5802839, 5803163, 5803579,5804175, 5804947, 5805559, 5816775, 5805287, 5817055, 5816993,0,5816957]
I hope that someone can help me to find the rest part or some tips are very welcome.
Thanks guys!!
I only can get the part of the end [5816993 - 0]
With this code:
for i, row in df_1.iterrows():
if df_2.empty:
x = df_1.loc[df_1['OUT'] == 0]
df_2['IN'] = x['IN']
df_2['OUT'] = x['OUT']
print('Estoy con DF Vacio {}'.format(i))
else:
pass