On Mar 26, 2:41 pm, Pavol Juhas <pavol.ju...@gmail.com> wrote:
> This has nothing to do with numpy, the issue is the string "%"
> operator
> cannot convert list to a float (Line 3 in your example gives a list).
> In '"%f" % x' the x has to be a number or tuple.
>
> Does not work:
>     print "%f" % [1.0]

Yes that helps. Why is it that the %-operator requires a tuple and
does not work with a list?

Thus why doesn't this work: "%d %d"%[2,2]
but instead it has to be: "%d %d"%tuple([2,2])
or: "%d %d"%(2,2)

Thanks
Roland
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to