how to create an array to numpy array?
def test(X, N):
[n,T] = X.shape
print \"n : \", n
print \"T : \", T
if __name__==\"__main__\":
X =
list object in python does not have 'shape' attribute because 'shape' implies that all the columns (or rows) have equal length along certain dimension.
Let's say list variable a has following properties:
a = [[2, 3, 4]
[0, 1]
[87, 8, 1]]
it is impossible to define 'shape' for variable 'a'. That is why 'shape' might be determined only with 'arrays' e.g.
b = numpy.array([[2, 3, 4]
[0, 1, 22]
[87, 8, 1]])
I hope this explanation clarifies well this question.