un_directed ids in pandas dataframe
<p>Okay, say i have two data frames which is seen as below:</p>

<pre><code>import pandas as pd

df1 = [{'time': '2016-11-01 17:38:25', 
        'id1': '49466',
        'id2': '6989', 
        'amount': '23.74'}]

df2 = [{'time': '2016-11-01 17:49:26', 
        'id1': '6989',
        'id2': '49466', 
        'amount': '25.32'}]
</code></pre>

<p>I then create the data frames. </p>

<pre><code>b_p = pd.DataFrame(df1)

s_p = pd.DataFrame(df2)
</code></pre>

<p>Within these frames I get: </p>

<pre><code>b_p: 

amount  id1 id2 time
0   23.74   49466   6989    2016-11-01 17:38:25

s_p:

amount  id1 id2 time
0   25.32   6989    49466   2016-11-01 17:49:26
</code></pre>

<p>As you can see in <code>id1</code> and <code>id2</code> respectfully, the b_p data frame show a connection but in the second dataframe it shows a connection just in reverse order. My question is, is there a way to make it where if an id is connected to another id that it upholds some commutative property in the second dataframe? Like can i store this somewhere and make sure it spots it in a second data frame? I already know that the two ids have been used because the first dataframe is a past data set, so when i look at the present data set I already know these users have had some sort of connection before. First time user, long time reader. Cheers </p>