# matte wrap code; fm size 3*10*5
a = zeros(3,10);
fm = [];
for kCh = 1:5
fm[:,:,kCh] = a;
# Python code, fm size 5*3*10
a = np.zeros((3,10));
fm = [];
for kCh in range(5):
fm.append(fm_val);
I implemented the matte wrap code above as follows.
Is there a way to expand an array that doesn't use append or extend?
I have to calculate the array, but the size changed when I used the phrase above, so the calculation value changed in the calculation value changed.
python array
Please refer to the code below.
import numpy as np
a = np.zeros((3,10));
fm = np.zeros((3,10,5))
for kCh in range(5):
fm[:,:,kCh]=a
print(fm)
© 2025 OneMinuteCode. All rights reserved.