set_index reset_index

set_index后原始数据以指定的列为index,在这个df对象上再 .loc[:,[x,y,z]] 选择要展示的列,筛选出来的df是含有指定列的索引信息的,需要继续reset_index(drop=True, inplace=True)一下

原文地址:https://www.cnblogs.com/cizao/p/13262784.html