I think you don't need the parenthesis here, you can just do "for index, line_data .."