Skip to content

Commit 9b5fe32

Browse files
committed
fixed np.where(non-zero ratings)
1 parent 480d037 commit 9b5fe32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ratings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ def recommendations(self):
4545
if tmp < minimum:
4646
closest = otherperson
4747
minimum = tmp
48-
notread = np.where(np.array(self.myratings == 0))
49-
maxindex = np.where(self.myratings[otherperson][notread] == self.myratings[otherperson][notread].max())
48+
notread = np.where(np.array(self.myratings[self.persons.index(otherperson)] == 0))
49+
print self.myratings
50+
print self.persons.index(otherperson)
51+
print notread
52+
maxindex = np.where(self.myratings[self.persons.index(otherperson)][notread] == self.myratings[self.persons.index(otherperson)][notread].max())
5053
allrecommendations[person] = self._data[otherperson][maxindex]
5154
return allrecommendations
5255

0 commit comments

Comments
 (0)