本文共 119 字,大约阅读时间需要 1 分钟。
df.insert(0, 'index', range(len(df)), allow_duplicates=False)
0表示放在第0列,range(len(df))为数据,allow_duplicates=False不允许列名重复。
转载地址:http://emiqf.baihongyu.com/