1
청크를 다른 행렬의 일부로 복사하려고합니다. 모든 종류의 n 차원 배열에 이것을 사용하려면 [] 연산자를 통해 오프셋이있는 목록을 적용해야합니다. 이것을 할 수있는 방법이 있습니까?파이썬 : 목록을 사용하여 [from : to] 임의 numpy 배열
mat_bigger[0:5, 0:5, ..] = mat_smaller[2:7, 2:7, ..]
같은 :
off_min = [0,0,0]
off_max = [2,2,2]
for i in range(len(off_min)):
mat_bigger[off_min[i] : off_max[i], ..] = ..
그래 내가 NumPy와 – dgrat
확인이 https://stackoverflow.com/questions/26506204/replace-sub-part-of-matrix-by-another-small-matrix-in-numpy를 사용합니까 – AndreyF
또는 [this] (https://stackoverflow.com/a/47605511/7207392) –