user1234440
user1234440

Reputation: 23567

Why is there this read_fwf() error?

When i am trying to read the fixed width file, it gives me that

Exception: Index (columns 0) have duplicated values ['12345']

The thing is, even though I have duplicated values, I still want the data incorporated. How could one get around this?

Upvotes: 0

Views: 401

Answers (1)

Garrett
Garrett

Reputation: 49856

Try calling read_fwf() with argument index_col=None to tell it that there are no index columns (which must be unique over all rows) -- it will automatically index rows with an integer starting at zero.

Upvotes: 1

Related Questions