自从上次使用grep已经有一段时间了,我需要一些帮助
这就是我要做的。对于输出,如下所示:
('Predicted:', [(u'n02504458', u'African_elephant', 0.99588591), (u'n01871265', u'tusker', 0.004068926), (u'n02504013', u'Indian_elephant', 4.499541e-05)])
我想grep三个变量n0250458,非洲象,和0.99588591。我还想将0.99588591存储为double以检查值,并以某种方式编辑一个python脚本以包含n0250458
我知道这似乎是很多,但任何帮助是非常感谢
编辑:
https://docs.python.org/2/tutorial/datastructures.html
我想我刚刚明白了。这是我得到第一个论点和第三个论点所做的
对于第一个参数:
对于第三个参数:
不过,我希望打印这两个函数,而不必调用
decode_predictions(preds, top=3)
函数两次。谢谢你的帮助相关问题 更多 >
编程相关推荐