i keep getting error "unexpected indent" line "lijst2 = lijst + [cat]" in following code. have no idea why, because far can see indentation seems correct? please keep in mind beginner. thank you! code:
for fileid in corpus.fileids(): tekst1 = corpus.words(fileid) instantie = defaultdict(float) cat = mijn_corpus.fileids() word in tekst1: if word in freq: instantie[word] +=1 word in freq: if word not in tekst1: instantie[word] +=0 lijst1 = [] key, value in instantie.iteritems(): lijst1.append(value) lijst2 = lijst + [cat] # here error message: unexpected indent resultaten.writerrow(lijst2)
you mixed spaces , tabs.
the line resultaten.writerrow(lijst2)
example starts tab, while other lines starts spaces (you copied question).
better use editor shows such characters:
Comments
Post a Comment