Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 python 中生成一个数组列表,类似于下面的 Matlab 代码:
for(t=1:Nmax) thisCell{t} = zeros(i,j,k) end
有人知道怎么做吗?
您可以使用列表理解和 numpy:
thisCell = [ numpy.zeros(shape=(i,j,k)) for t in range(1, Nmax) ]