Skip to content
Browse files

I now have a class that fills the arrays of PEOPLE and PAPERS :) Yeaa…

…aaah
  • Loading branch information...
1 parent 7ea1416 commit 50258067eac96dcccd4d02b742236ec299370df0 @Yalda committed Feb 22, 2012
Showing with 46 additions and 0 deletions.
  1. +46 −0 SecondPythonProgram.py
View
46 SecondPythonProgram.py
@@ -0,0 +1,46 @@
+import inputdata
+import numpy
+
+data = inputdata.raw_scores
+
+
+def main():
+ newElements = elements()
+
+
+class elements(object):
+ ''' I am all elements needed for recommendation :) '''
+ def __init__(self):
+ self.people = []
+ self.papers = []
+ self.ratings = [[]]
+
+ ''' fill people[] '''
+ for person,ratings in data.iteritems():
+ self.people.append(person)
+
+ ''' fill papers[] '''
+ for person,readPapers in data.iteritems():
+ for paper,rate in readPapers.iteritems():
+ newPaper = True
+ for item in self.papers:
+ if item == paper:
+ newPaper = False
+ if newPaper:
+ self.papers.append(paper)
+
+ '''fill ratings'''
+ for person,readPapers in data.iteritems():
+ for paper,rate in readPapers.iteritems():
+
+
+ self.ratings[0].append(0)
+ print self.ratings
+
+
+
+
+main()
+
+
+

0 comments on commit 5025806

Please sign in to comment.
Something went wrong with that request. Please try again.