python - How to replace ndarray with a number? -


i have following code:

arr = zip(*people2) in range(len(arr)):     j in range(len(arr[i])):         k in range(len(arr[i][j])):             if(arr[i][j][k] == 1):                 arr[i][j] = k                 break 

there array of arrays of arrays. need replace these last arrays numbers. this:

[  [[1, 0, 0], [2, 0, 0]],  [[3, 0, 0], [4, 0, 0]], ]  ->  [  [1, 2],  [3, 4] ] 

numbers here example.

how can this? tried use numpy.resize(), doesn't work.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -