Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I now have a class that fills the arrays of PEOPLE and PAPERS :) Yeaa…
…aaah
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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() | |||
|
|||
|
|||
|