在下面我得到错误
IndentationError: unindent does not match any outer indentation level (hisrel_split.py, line 25)
这是elif
行。我检查了我所有的缩进,甚至重新输入了很多。要么我在这里遗漏了一些明显的东西,要么有一些我不知道的微妙规则。有任何想法吗
from numpy import *
from pylab import *
import sys
ifp = open(sys.argv[1],"r").readlines()
data_1 = []
data_2 = []
data = []
last = int(ifp[-1].split()[0])
set_1 = range(int(round(last)/2))
set_2 = range(int(round(last)/2),(last+1))
for i in ifp:
d = i.split()
try:
data.append(eval(d[2]))
except:
continue
if eval(d[0]) in set_1 and eval(d[1]) in set_1:
try:
data_1.append(eval(d[2]))
except:
continue
elif eval(d[0]) in set_2 and eval(d[1]) in set_2:
print "yes"