I suggest you stop a minute and think about what a node means to you and your data.
If the data says 25, why isn't that the same node as the 25 that appears in the other column?
That is how using a dataframe as an edgelist works. The value indicates which node and the
column says whether that node is the source of the edge or the target of the edge.
So, if your data has 25 in the source column and 25 in the target column then you have a selfloop.
Make sure you understand what is happening before you try doing something like this with a large dataset.
Best,
Dan