Numpy ‘smart’ symmetric matrix
- by Debilski
Is there a smart and space-efficient symmetric matrix in numpy which automatically fills [j][i] when [i][j] is written to?
a = numpy.symmetric((3, 3))
a[0][1] = 1
print a
# [[0 1 0], [1 0 0], [0 0 0]]
An automatic Hermitian would also be nice, although I won’t need that at the time of writing.