a = np.array([[0, 0, 0, 0], [1, 0, 0, 0], [2, 3, 0, 0], [4, 5, 6, 0]])
irows, icols = np.triu_indices(len(a), 1)
a[irows, icols] = a[icols, irows]
Python — How can I find the square matrix of a lower triangular numpy matrix? (with a symmetrical upper triangle)