I have two 6x6 matrices. Here I'll just show the first two rows and columns:
import sympy as sp
values = sp.Matrix([[-0.403900000000000, 0.158730000000000], [-1.52350000000000, -1.87937000000000]])
uncertainties = sp.Matrix([[0.000600000000000000, 0.000280000000000000], [0.000270000000000000, 0.000170000000000000]])
I want to get a matrix where the [0][0]
element would look like "-0.4039 +- 0.0006
". And this for every element, so that i can export this matrix to latex.
How do I do this?
I tried using
f"{values[i][j]} +- {uncertainties[i][j]}"
for all i and j, but that just gave me value[i][j] - uncertainty[i][j]
I couldn't find this on the internet. Do I need to look into latex for loops? Or can I do that in sympy? I jsut really really don't want to manually put the uncertainty behind every matrix element in multiple matrices.
Thanks!