Python Forum
Indentation Error With If Else Statement
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Indentation Error With If Else Statement
#4
This is one of those times when the Python error message isn't all that useful. I think this should be flagged as a syntax error, a floating else statement without a corresponding if or for. As in:
        if Data_Temp == data_frame_current.iloc[b,0]:
            else:
                data_frame_current.drop(index=[b,0])
After all, "else" is the first statement following "if". But I guess indentation is either more important or is checked first.
Reply


Messages In This Thread
RE: Indentation Error With If Else Statement - by deanhystad - Aug-02-2020, 08:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  An unexplainable error in .format statement - but only in a larger piece of code? ToniE 4 850 Sep-05-2023, 12:50 PM
Last Post: ToniE
  Error in Using INPUT statement gunwaba 1 2,232 Jul-03-2022, 10:22 PM
Last Post: deanhystad
  Cryptic Error with import statement Led_Zeppelin 2 2,714 Jan-11-2022, 01:13 PM
Last Post: Led_Zeppelin
  syntax error on return statement l_butler 5 3,275 May-31-2020, 02:26 PM
Last Post: pyzyx3qwerty
  Indentation error... lol ironfelix717 8 3,997 Apr-02-2020, 02:31 PM
Last Post: buran
  Error in continue statement Man_from_India 1 1,641 Feb-02-2020, 02:23 PM
Last Post: Larz60+
  Syntax Error (elif statement) Kanashi 0 3,769 Nov-20-2019, 11:29 PM
Last Post: Kanashi
  Error with simple "or" statement? Mark17 4 2,462 Nov-15-2019, 05:16 PM
Last Post: Mark17
  Getting error message for indentation Shafla 5 2,989 May-07-2019, 08:56 PM
Last Post: Yoriz
  Help please - indentation error bil007 1 2,140 Mar-24-2019, 11:41 AM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020