I am working on a code to calculate distances between each and every string in a row. My code is working good. However, my problem now is in filtering my results for example I have the following resulted data frame :
nodeA nodeB distance_score
0 0 0
0 1 95
0 2 105
1 0 95
1 1 0
1 2 128
........
I want to remove one of rows that belongs to the same nodes for example for the pair (0,1) and (1,0) one entry is enough. Based on my experience in Matlab, I could've done so by iterating over two loops and store the elements of each loop in an array and then check if the are already elements in these arrays and remove them. But I dont think this is the optimized way to do it in python since I have a huge data files and doing so will cost a lot