According to this post How to define two-dimensional array in python ,
we can create one two-dimensional array var
Matrix = [[0 for x in range(5)] for x in range(5)]
or
numpy.zeros((5, 5))
It seems the type of value in this matrix is same. Am I right?
Now, I want one matrix like
matrix =
[[ 0, ['you', 'are', 'here']],
[ 1, ['you', 'are', 'here']],
...
]
Also can get the result of the column 0
is [0, 1, ...]
, and column 1
is [['you', 'are', 'here'], ['you', 'are', 'here']]
.
Is that possible in Python? If so, how to implement it efficiently?