加之前:
+1完了之后发现多出一列的索引
import pandas as pd
path="E:\PyCharmProjects\machineLearn_model\Digits_classification_predictor\LRresult.csv"
result = pd.read_csv(path)
print(result.head())
result["imageId"] = result["imageId"]+1 # imageId列+1
result.to_csv(path, index=True, encoding='utf-8')
print(result)
把index=True改为index=False就好啦