This is continued from this thread: Python matrix, any solution?
Input
from numpy import *
import numpy
x=[['1','7'],
['1.5', '8'],
['2', '5.5'],
['2','9']]
Code
y = x[:, :, None] * x[:, None]
print y.sum(axis=0)
I received error:
"list indices must be integers, not tuple"
But if x is
x = numpy.array([[1, 7], [1.5, 8], [2, 5.5], [2, 9]])
then it's ok, but I don't have such input.