"Now, since we have generated the pairs of the records, a particular record may be present with many other records records and Hence their would be duplicates in the row and column list"

I don't understand what you are saying here. Could you explain more.  Could you use http://networkx.lanl.gov/reference/generated/networkx.linalg.graphmatrix.adjacency_matrix.html ?