The error seems to point to an empty tuple.
Based on the line of code, if looks like input is empty, as you’ll get the same error message here:
x = ()
x[0]
> IndexError: tuple index out of range

As I said, it’s hard to debug your issue, if you post images instead of a (small) executable code snippet.