- What I wanna process is slice 2D array partially without numpy module like following example with numpy.
and I want to know Time Complexity of Slicing Lists in python basic function
import numpy as np A = np.array([ [1,2,3,4,5,6,7,8] for i in range(8)]) n = len(A[0]) x = int(n/2) TEMP = [[None]*2 for i in range(2)] for w in range(2): for q in range(2): TEMP[w][q] = A[w*x:w*x+x,q*x:q*x+x] for w in range(2): for q in range(2): print(TEMP[w][q])
here is the result that i wanna get
[[1 2 3 4]
[1 2 3 4]
[1 2 3 4]
[1 2 3 4]]
[[5 6 7 8]
[5 6 7 8]
[5 6 7 8]
[5 6 7 8]]
[[1 2 3 4]
[1 2 3 4]
[1 2 3 4]
[1 2 3 4]]
[[5 6 7 8]
[5 6 7 8]
[5 6 7 8]
[5 6 7 8]]
Process finished with exit code 0
