在网上没找到,自己试了试,成功了记录一下。
任务
在一个6000多行的dataframe中,根据所需的index列表筛选输出。
wantlist=[1, 2, 3, 4, 5, 6, 8, 9, 12, 13, 19, 22, 26, 31, 34, 35, 36, 37, 39, 41, 44, 45, 46, 49, 51, 54, 57, 58, 61, 65, 69, 70, 71, 72, 76, 78, 83, 84, 86, 87, 88, 90, 92, 93, 96, 102, 104, 106, 107, 116, 118, 120, 122, 125, 126, 128, 129, 133, 134, 135, 136, 137, 141, 144, 145, 146, 149, 152, 154, 156, 158, 159, 160, 164, 165, 167, 168, 170, 171, 173, 176, 177, 178, 181, 182, 183, 195, 200, 201, 202, 215, 216, 217, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 235, 238, 240, 246, 247, 248, 249, 250, 253, 260, 261, 262, 264, 265, 266, 270, 271, 272, 273, 274, 278, 280, 281, 283, 287, 289, 291, 292, 293, 294, 295, 296, 300, 301, 304, 305, 306, 308, 309, 315, 316, 317, 318, 319, 324, 325, 326, 329, 330, 331, 333, 337, 342, 343, 344, 345, 347, 348, 349, 352, 353, 354, 355, 356, 359, 361, 362, 365, 367, 369, 371, 372, 374, 376, 377, 378, 379, 380, 381, 382, 383, 384, 386, 387, 388, 389, 391, 392, 393, 395, 396, 397, 398, 400, 401, 403, 404, 406, 408, 409, 410, 412, 413, 414, 416, 418, 419, 420, 424, 425, 426, 427, 428, 431, 432, 433, 435, 436, 439, 441, 443, 445, 446, 447, 448, 449, 450, 451, 452, 453, 457, 458, 459, 461, 462, 463, 464, 465, 467, 468, 469, 471, 480, 481, 482, 483, 485, 487, 490, 492, 493, 494, 495, 496, 499, 501, 502, 503, 504, 508, 509, 510, 511, 513, 517, 518, 519, 520, 521, 522, 523, 524, 526, 530, 532, 533, 535, 537, 538, 542, 543, 544, 545, 550, 551, 552, 553, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 567, 568, 570, 571, 572, 576, 577, 578, 581, 583, 584, 587, 588, 589, 590, 591, 592, 593, 594, 596, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 616, 617, 618, 620, 621, 622, 623, 624, 625, 626, 628, 631, 632, 633, 634, 635, 636, 639, 641, 644, 647, 648, 650, 653, 654, 655, 656, 657, 658, 659, 660, 661, 663, 664, 665, 666, 667, 670, 671, 680, 681, 682, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 698, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 713, 714, 715, 716, 717, 718, 719, 721, 723, 726, 728, 729, 730, 731, 732, 733, 752, 753, 754, 755, 760, 761, 762, 763, 767, 768, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 785, 786, 787, 788, 789, 790, 791, 792, 793, 795, 796, 797, 798, 800, 801, 802, 803, 804, 807, 808, 809, 810, 811, 812, 813, 814, 815, 817, 818, 819, 820, 822, 823, 824, 825, 826, 829, 831, 832, 833, 835, 836, 837, 840, 842, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 859, 860, 863, 865, 866, 867, 870, 871, 872, 873, 874, 877, 878, 879, 880, 881, 883, 885, 886, 887, 890, 891, 892, 893, 894, 895, 896, 898, 899, 900, 901, 902, 903, 905, 907, 908, 909, 912, 914, 915, 916, 917, 918, 919, 920, 922, 923, 924, 925, 926, 927, 928, 931, 933, 934, 935, 937, 938, 939, 940, 941, 944, 945, 946, 947, 948, 949, 950, 951, 952, 954, 956, 958, 960, 962, 963, 964, 966, 967, 968, 969, 970, 971, 972, 973, 975, 977, 979, 980, 982, 983, 984, 985, 986, 987, 988, 989, 990, 992, 993, 994, 995, 996, 997, 998, 999, 1003, 1004, 1005, 1006, 1008, 1009, 1010, 1012, 1013, 1014, 1015, 1016, 1017, 1021, 1022, 1024, 1025, 1029, 1030, 1031, 1033, 1034, 1035, 1036, 1037, 1039, 1040, 1042, 1044, 1045, 1046, 1047, 1048, 1049, 1051, 1052, 1053, 1055, 1056, 1057, 1058, 1059, 1061, 1062, 1063, 1066, 1067, 1068, 1070, 1071, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1087, 1088, 1089, 1091, 1092, 1093, 1094, 1095, 1100, 1102, 1103, 1104, 1105, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1145, 1146, 1147, 1148, 1150, 1152, 1153, 1154, 1155, 1159, 1161, 1164, 1166, 1168, 1169, 1172, 1174, 1178, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1189, 1190, 1191, 1192, 1194, 1195, 1196, 1198, 1199, 1200, 1201, 1202, 1203, 1205, 1206, 1207, 1208, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1233, 1235, 1237, 1238, 1239, 1241, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1253, 1255, 1256, 1257, 1258, 1259, 1261, 1262, 1263, 1266, 1267, 1268, 1269, 1270, 1271, 1273, 1274, 1275, 1277, 1278, 1279, 1280, 1281, 1282, 1284, 1285, 1286, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295, 1297, 1298, 1299, 1301, 1302, 1304, 1305, 1306, 1307, 1308, 1310, 1311, 1314, 1315, 1316, 1317, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1334, 1335, 1336, 1337, 1338, 1339, 1345, 1347, 1350, 1352, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, 1363, 1364, 1365, 1367, 1368, 1370, 1371, 1372, 1376, 1377, 1378, 1379, 1380, 1381, 1386, 1388, 1389, 1391, 1392, 1393, 1395, 1396, 1397, 1398, 1400, 1402, 1404, 1405, 1406, 1407, 1408