There are two pandas DataFrames
-
Asized 10 x 4 (4 columns) -
Bsized 10 x 2 (2 columns)
Both of their indices (row numbers) are identical, running from 1 to 10 in ascending order.
But If I sort B according to its first column using B.sort_values(by='column 1'), its indices will change to something looking disordered, no longer straight1 to 10.
How can I re-sort A the same way that B was sorted, so that its indices are also in the same (dis-)ordering?
没有评论:
发表评论