I have pandas a dataframe like this
Event_Id Investigation_Type Accident_Number Event_Date
0 20180922X71035 ACCIDENT DCA18CA289 09/10/2018
1 20180507X00658 ACCIDENT DCA18CA169 05/07/2018
4 20171212X50255 ACCIDENT DCA18CA043B 12/03/2017
and I try to iterate through it like this...
n1col = 0
n2col = 1
for i in df.index:
Node1=df.Event_Id
for j in df.index:
Node2=df.Event_Id
if (Node1 != Node2):
new_df.loc[j,n1col] = Node1
new_df.loc[j,n2col] = Node2
I don't know if my approach is right (as I see it's not) I want some help so I can get a result like the one below...
I am new to that kind of stuff so I need your help.
Node_1 Node_2
0 20180922X71035 20180507X00658
1 20180922X71035 20171212X50255
2 20180507X00658 20180922X71035
3 20180507X00658 20171212X50255
4 20171212X50255 20180922X71035
6 20171212X50255 20180507X00658
Thanks in Advance.