Tôi đang dịch một chương trình từ MATLAB sang Python."permute" của MATLAB trong python
Mã matlab sử dụng phương pháp hoán vị:
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.
Có một phương pháp tương đương bằng Python/NumPy?
[numpy.rollaxis] (http://docs.scipy.org/doc/numpy/reference/generated/numpy.rollaxis.html#numpy.rollaxis) gần ... – mgilson
@Maurits Đó là hoán vị ngẫu nhiên. Vì không có gì ngẫu nhiên trong mô tả về hàm "permute" trong MATLAB, tôi giả sử nó không phải là ngẫu nhiên ... – LynnH
@ user1729698 Lỗi của tôi. – Maurits