「Python」Numpy equivalent of MATLAB's cell array
2021-06-27 02:03
标签:list mount hold numpy this sequence type python cts 转自Stackoverflow。备忘用。 I want to create a MATLAB-like cell array in Numpy. How can I accomplish this? Matlab cell arrays are most similar to Python To be honest though you are just as well off using Python 「Python」Numpy equivalent of MATLAB's cell array 标签:list mount hold numpy this sequence type python cts 原文地址:https://www.cnblogs.com/samhx/p/9654817.htmlQuestion
Answer
list
s, since they can hold any object - but scipy.io.loadmat
imports them as numpy object arrays - which is an array with dtype=object.list
s - 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).
文章标题:「Python」Numpy equivalent of MATLAB's cell array
文章链接:http://soscw.com/index.php/essay/98238.html