Python DataFrame 如何删除原来的索引,重新建立索引
删除行索引重排:
ser.reset_index(drop = True)
df.reset_index(drop = True)
------------------------------------------
直接修列索引:
df = pd.DataFrame(df,columns = ['One','Two','Three'])
bling bling
删除行索引重排:
ser.reset_index(drop = True)
df.reset_index(drop = True)
------------------------------------------
直接修列索引:
df = pd.DataFrame(df,columns = ['One','Two','Three'])