Given a file in the format below:
a a 0
a b 1
a c 1
b b 0
b a 1
b c 1
c c 0
c a 1
c b 1
The third column is the distance between the items in the first and second columns. If I read such a file into pyton as a nested list, how do I convert it to a symmetrical matrix, i.e.,
a b c
a 0 1 1
b 1 0 1
b 1 1 0
? I also wish to include the column and row names.
I would preferably like to use numpy to complete this task.
Any suggestions?
Thanks, D.