I am trying to calculate the eigenvectors of many 3x3 matrices using python. My code in python is based on code from Mathematica which uses the Eigenvector[] function. I have tried using the eig() function from both numpy and scipy and the majority of the time the eigenvectors calculated in mathematica and python are identical. However, there are a few instances which the eigenvectors calculated in python are opposite in sign to those calculated in mathematica.
I have already tried …