本文整理匯總了Python中Problem.Problem.loadLine方法的典型用法代碼示例。如果您正苦於以下問題:Python Problem.loadLine方法的具體用法?Python Problem.loadLine怎麽用?Python Problem.loadLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Problem.Problem
的用法示例。
在下文中一共展示了Problem.loadLine方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: dict
# 需要導入模塊: from Problem import Problem [as 別名]
# 或者: from Problem.Problem import loadLine [as 別名]
__author__ = 'YanChenDeng'
from Problem import Problem
import csv
read=csv.reader(file('A1Ratings.csv','rb'))
problem=Problem()
for line in read:
problem.loadLine(line)
print 'mean rating:'
print dict(zip(problem.moviesName,[('%.2f')%f for f in problem.meanRating()]))
print 'rating count:'
print dict(zip(problem.moviesName,[('%.2f')%f for f in problem.ratingCount()]))
print 'high rating:'
print dict(zip(problem.moviesName,[('%.2f')%f for f in problem.highRating()]))
print 'relevance of Star Wars: Episode IV - A New Hope (1977):'
print dict(zip(problem.moviesName,[('%.2f')%f for f in problem.calcRelevance('260: Star Wars: Episode IV - A New Hope (1977)')]))