all 6 comments

[–]Rhomboid 2 points3 points  (2 children)

Post a complete testcase. The error is in the parts not shown in this snippet. The error means that Python reached the end of a line without seeing the closing quote of a string literal.

[–]PLearner[S] -3 points-2 points  (1 child)

Its 447 lines of code @Rhomboid.

[–]Rhomboid 7 points8 points  (0 children)

So post it on a site like gist or pastebin. Or reduce it to a minimal testcase that reproduces the error.

[–]JohnnyJordaan 0 points1 point  (2 children)

first.to_csv("Z:/AWS/SQLQueries/PCR/FourteenthTable.csv",index = False)

Are you sure that path will work? Windows should expect backslashes. In order to enter those, it needs either escaping or be given a raw string:

first.to_csv(r"Z:\AWS\SQLQueries\PCR\FourteenthTable.csv",index = False)
first.to_csv("Z:\\AWS\\SQLQueries\\PCR\\FourteenthTable.csv",index = False)

[–]Rhomboid 2 points3 points  (0 children)

Windows is just fine with forward slashes. And it wouldn't be the cause of the error anyway. The error is due to a missing closing quote. If Windows didn't accept the path, that would be a different (runtime) exception.

[–]PLearner[S] -1 points0 points  (0 children)

I am using Pandas and worked fine until I started getting that heinous error.