I want to slice in the (a) list so that it takes 3 from each list and makes a list of 9, but doesn’t go to the next (a) list until all members of the list have been separated by 9.
import rhinoscriptsyntax as rs
for i in range(2):
a =[[[[1, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 1, 0]]]]
for t,n in enumerate(a):
for i,k in enumerate(n):
for j,w in enumerate(n):
s = [n[t][i][j] , n[t][i][j+1] , n[t][i][j+2] , n[t][i+1][j] , n[t][i+1][j+1] ,\
n[t][i+1][j+2] , n[t][i+2][j] , n[t][i+2][j+1] , n[t][i+2][j+2]]
This is the result:
a =[[[[1, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 1, 0]]]]
s = [1, 0, 0, 0, 1, 0, 1, 1, 0]
a =[[[[1, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 1, 0]]]]
s = [1, 0, 0, 0, 1, 0, 1, 1, 0]
But i want this result:
a =[[[[1, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 1, 0]]]]
s = [[1, 0, 0, 0, 1, 0, 1, 1, 0],[1, 1, 0, 0, 1, 1, 0, 1, 0]]
a =[[[[1, 0, 0, 1, 1, 0], [0, 1, 0, 0, 1, 1], [1, 1, 0, 0, 1, 0]]]]
s = [[1, 0, 0, 0, 1, 0, 1, 1, 0],[1, 1, 0, 0, 1, 1, 0, 1, 0]]
more information: