开发者

Numpy equivalent of MATLAB's cell array

开发者 https://www.devze.com 2022-12-12 11:49 出处:网络
I want to create a MATLAB-like cell array in Numpy. How can I accomplish 开发者_C百科this?Matlab cell arrays are most similar to Python lists, since they can hold any object - but scipy.io.loadmat imp

I want to create a MATLAB-like cell array in Numpy. How can I accomplish 开发者_C百科this?


Matlab cell arrays are most similar to Python lists, since they can hold any object - but scipy.io.loadmat imports them as numpy object arrays - which is an array with dtype=object.

To be honest though you are just as well off using Python lists - if you are holding general objects you will loose almost all of the advantages of numpy arrays (which are designed to hold a sequence of values which each take the same amount of memory).

0

精彩评论

暂无评论...
验证码 换一张
取 消