In MATLAB, to swap the first and second columns of a table A
, one would do this1
A = A(:, [2 1 3:end]);
Is there a similarly convenient way to do this if A
were a pandas DataFrame
instead?
1 MATLAB uses 1-based indexing.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…