Skip to content

Commit

Permalink
I now have a class that fills the arrays of PEOPLE and PAPERS :) Yeaa…
Browse files Browse the repository at this point in the history
…aaah
  • Loading branch information
Yalda committed Feb 22, 2012
1 parent 7ea1416 commit 5025806
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions 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.