loc函数:通过行索引 "Index" 中的具体值来取行数据(如取"Index"为"A"的行)
iloc函数:通过行号来取行数据(如取第二行的数据)
利用loc函数的时候,当index相同时,会将相同的Index全部提取出来,优点是:如果index是人名,数据框为所有人的数据,那么我可以将某个人的多条数据提取出来分析;缺点是:如果index不具有特定意义,而且重复,那么提取的数据需要进一步处理,可用.reset_index()函数重置index
原文:https://blog.csdn.net/W_weiying/article/details/81411257?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase