Skip to main content

IndexError: list index out of range

Answered

Comments

1 comment

  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Geoffrey!

    Most likely, there is an empty line in your text file. You would need to catch this edge case to avoid such errors.

    Maybe it makes sense to look into some existing parsers, e.g., from the pandas module (Pandas: How to Read and Write Files – Real Python) to generate a DataFrame right away and have a more robust parser with more options and flexibility.

    Cheers,
    Matthias

    0

Please sign in to leave a comment.