19
我正在将一个程序从matlab翻译成Python。python中的“排列”
的MATLAB代码使用方法置换:
B = PERMUTE(A,ORDER) rearranges the dimensions of A so that they
% are in the order specified by the vector ORDER. The array produced
% has the same values as A but the order of the subscripts needed to
% access any particular element are rearranged as specified by ORDER.
% For an N-D array A, numel(ORDER)>=ndims(A). All the elements of
% ORDER must be unique.
是否有在Python/NumPy的等效的方法?
[numpy.rollaxis](http://docs.scipy.org/doc/numpy/reference/generated/numpy.rollaxis.html#numpy.rollaxis)... – mgilson
@Maurits这是随机排列。由于在matlab中函数“permute”的描述中没有任何关于随机的我认为它不是随机的... – LynnH
@ user1729698我的错误。 – Maurits