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.