本文整理汇总了Python中Features.keys方法的典型用法代码示例。如果您正苦于以下问题:Python Features.keys方法的具体用法?Python Features.keys怎么用?Python Features.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Features
的用法示例。
在下文中一共展示了Features.keys方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: import Features [as 别名]
# 或者: from Features import keys [as 别名]
#~ print("Making feature matrix")
#~ features_list = [Features(paper_getter.getPaper(i)) for i in ids]
#~ print("Making citation vector")
#~ citation_list = [Citations(cr_getter.getPaper(i)) for i in ids]
#~ l = cr_getter.getPaper(ids[1])['sources'][0]['histories']
#~ l = cr_getter.getPaper(ids[1])['sources'][0]['histories']
f = Features(paper_getter.getPaper(ids[0]))
#~ print("b")
#~ c = Citations(cr_getter.getPaper(ids[0]))
#~ print("c")
fil = open("/tmp/citaugur.csv","w")
#~ print("d")
head = ",citations," + ",".join([str(i) for i in f.keys()]) + "\n"
#~ print("e")
fil.write(head)
#~
ct = 0
for i in ids:
c = Citations(cr_getter.getPaper(i))
if c:
if(len(c) >0):
f = Features(paper_getter.getPaper(i))
s = i + ","
s = s + ",".join([str(i) for i in c.values()]) + ","
s = s + ",".join([str(i) for i in f.values()]) + "\n"
fil.write(s)
ct += 1