Python Pandas DataFrame to_csv strange format

牧云@^-^@ 提交于 2019-12-07 13:16:30

It seemed that this part of the script was doing all the damage:

    #DataFrame Manipulation:
    df = pd.read_pickle(path + picklefile)
 -> df['Concatenated String Index'] = str(100000*df.FileID + df.ID).zfill(10)
    df['ConcatIndex'] = 100000*df.FileID + df.ID
    df.index = df.ConcatIndex

When transforming those indexes to a string it returns the string of the whole transformed index and that's why it appeared strange. Turned that line of code into a for each loop and works out fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!