Iterate through tensor in paraview programable filter


I would like to iterate over a tensor in paraview to compute its eigenvalues and eigenvectors. But currently I am unable to do so.

I have:

import numpy as np

input0 = inputs[0]
data = input0.CellData["tau"]

nCells = input0.GetNumberOfCells()
eigenVals = np.zeros((nCells, 3))
eigVecs= np.zeros((nCells, 3, 3))

for i in range(nCells):
  T = # How can I get the numpy array representing the data? 
 eigenVals[i], eigVecs[i] =np.linalg.eig(T)


How can I fix this?

Anyone that can help with how to iterate over a field in paraview?

How about
T = np.array( data[i,:,:] )