Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我试图读取固定宽度的文件时,它给了我
Exception: Index (columns 0) have duplicated values ['12345']
问题是,即使我有重复的值,我仍然希望合并数据。怎么能绕过这个?
尝试read_fwf()使用参数调用index_col=None来告诉它没有索引列(在所有行中必须是唯一的)——它会自动索引从零开始的整数的行。
read_fwf()
index_col=None