我有以下数据框:
x-coord y-coord
1 1150.0 1760.0
2 630.0 1660.0
3 40.0 2090.0
4 750.0 1100.0
5 750.0 2030.0
6 1030.0 2070.0
7 1650.0 650.0
8 1490.0 1630.0
9 790.0 2260.0
10 710.0 1310.0
11 840.0 550.0
12 1170.0 2300.0
13 970.0 1340.0
14 510.0 700.0
15 750.0 900.0
16 1280.0 1200.0
17 230.0 590.0
18 460.0 860.0
19 1040.0 950.0
20 590.0 1390.0
21 830.0 1770.0
22 490.0 500.0
23 1840.0 1240.0
24 1260.0 1500.0
25 1280.0 790.0
26 490.0 2130.0
27 1460.0 1420.0
28 1260.0 1910.0
29 360.0 1980.0
以及以下列表:
['1', '28', '6', '12', '9', '5', '26', '29', '3', '2', '20', '10', '4', '15', '18', '17', '14', '22', '11', '19', '25', '7', '23', '27', '8', '24', '16', '13', '21']
该列表包含数据框的索引。我正在尝试根据列表重新排列数据帧的索引。
ie, something like this
1 1150.0 1760.0
28 1260.0 1910.0
6 1030.0 2070.0
22 490.0 500.0
.............................
.............................
我对如何执行此操作一无所知。有想法专家吗?
谢谢, Arnab