Tagged Questions
1
vote
4answers
60 views
Indexing a nested list in python
Given data as
data = [ [0, 1], [2,3] ]
I want to index all first elements in the lists inside the list of lists. i.e. I need to index 0 and 2.
I have tried
print data[:][0]
but it output the ...
1
vote
1answer
252 views
numpy: iterate over nested array
Im trying to iterate over a nested (numpy) array using np.nditer().
Converted a nested list of ints to a nested numpy array.
from numpy import mean, array, nditer
nested_list = ...