首页 > 其他 > 详细

代码8

时间:2017-01-06 13:51:21      阅读:122      评论:0      收藏:0      [点我收藏+]

代码

for i in range(183):
    num = 79*i
    f = open(/home/xbwang/xingyu/predictions old/results-dependency.1l.150d.epoch-1.0.02215.10005.pred,r).readlines()[num:num+79]
    #print f
    max = 0
    index = 0
    for j in range(79):
        x = f[j:j+1][0].strip()
        #print x
        y =int(x)
        print y
        #y = x[0].strip()
        #print y
        #z = int(y)
        #print z
        if(x >= max):
            max = x
            index = j
    #f1 = open(‘/home/xbwang/Desktop/maxscore.txt‘,‘a‘)
    #f1.write(str(max)+‘\n‘)
    #f2 = open(‘/home/xbwang/Desktop/test.txt‘,‘a‘)
    #f2.write(str(index)+‘\n‘)

报错

xbwang@xbwang-desktop:~/Desktop$ python getscore.py 
Traceback (most recent call last):
  File "getscore.py", line 10, in <module>
    y =int(x)
ValueError: invalid literal for int() with base 10: 0.0137737934

 

代码8

原文:http://www.cnblogs.com/ymjyqsx/p/6255831.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!