Как я могу решить ошибку отступа в Python
for i,row in train_df.iterrows(): if row['Age']>0 and row['Age']<=10: if row['Pclass']==1 : sp11=sp11+row['Survived'] cp11=cp11+1 elif row['Pclass']==2: sp12=sp12+row['Survived'] cp12=cp12+1 else: sp13=sp13+row['Survived'] cp13=cp13+1 if row['Age']>10 and row['Age']<=20: if row['Pclass']==1 : sp21=sp21+row['Survived'] cp21=cp21+1 elif row['Pclass']==2: sp22=sp22+row['Survived'] cp22=cp22+1 else: sp23=sp23+row['Survived'] cp23=cp23+1 if row['Age']>20 and row['Age']<=30: if row['Pclass']==1 : sp31=sp31+row['Survived'] cp31=cp31+1 elif row['Pclass']==2: sp32=sp32+row['Survived'] cp32=cp32+1 else: sp33=sp33+row['Survived'] cp33=cp33+1 if row['Age']>30 and row['Age']<=40: if row['Pclass']==1 : sp41=sp41+row['Survived'] cp41=cp41+1 elif row['Pclass']==2: sp42=sp42+row['Survived'] cp42=cp42+1 else: sp43=sp43+row['Survived'] cp43=cp43+1 if row['Age']>40 and row['Age']<=50: if row['Pclass']==1 : sp51=sp51+row['Survived'] cp51=cp51+1 elif row['Pclass']==2: sp52=sp52+row['Survived'] cp52=cp52+1 else: sp13=sp13+row['Survived'] cp13=cp13+1 if row['Age']>50 and row['Age']<=60: if row['Pclass']==1 : sp61=sp61+row['Survived'] cp61=cp61+1 elif row['Pclass']==2: sp62=sp62+row['Survived'] cp62=cp62+1 else: sp63=sp63+row['Survived'] cp63=cp63+1
Что я уже пробовал:
Я попытался отрегулировать интервал, но снова и снова получаю следующую ошибку.
Выход:
File "<tokenize>", line 65 if row['Age']>10 and row['Age']<=20: ^ IndentationError: unindent does not match any outer indentation level