SyntaxError: unexpected EOF while parsing

前端 未结 6 913
抹茶落季
抹茶落季 2020-11-28 06:44

I am getting error while running this part of the code. tried some of the existing solutions, none of them helped

elec_and_weather = pd.read_csv(r\'C:\\HOUR.         


        
6条回答
  •  半阙折子戏
    2020-11-28 07:31

    My syntax error was semi-hidden in an f-string

     print(f'num_flex_rows = {self.}\nFlex Rows = {flex_rows}\nMax elements = {max_elements}')
    

    should be

     print(f'num_flex_rows = {self.num_rows}\nFlex Rows = {flex_rows}\nMax elements = {max_elements}')
    

    It didn't have the PyCharm spell-check-red line under the error.

    It did give me a clue, yet when I searched on this error message, it of course did not find the error in that bit of code above.

    Had I looked more closely at the error message, I would have found the '' in the error. Seeing Line 1 was discouraging and thus wasn't paying close attention :-( Searching for

    self.)

    yielded nothing. Searching for

    self.

    yielded practically everything :-\

    If I can help you avoid even a minute longer of deskchecking your code, then mission accomplished :-)

    C:\Python\Anaconda3\python.exe C:/Python/PycharmProjects/FlexForms/FlexForm.py File "", line 1 (self.) ^ SyntaxError: unexpected EOF while parsing

    Process finished with exit code 1

提交回复
热议问题