Added a filter to obtain only pertinent news

This commit is contained in:
Eddie 2017-11-10 11:17:27 -06:00
parent f9830e61d2
commit 39377b0bf9
1 changed files with 15 additions and 1 deletions

View File

@ -28,4 +28,18 @@ del dataVect, stop_words, vectorizer # , corpus
J = X.toarray() J = X.toarray()
print(J) # print(J)
index = []
for x in range(0, len(J)):
if sum(J[x]) != 0:
index.append(x)
index = tuple(index)
electCorp = [corpus[x] for x in index]
del corpus
print(electCorp)