[Numpy-discussion] Variable String Format

Bill Baxter wbaxter at gmail.com
Fri Mar 9 14:46:23 EST 2007


str(A)[1:-1] ?

--bb

On 3/10/07, lechtlr <lechtlr at yahoo.com> wrote:
>
>  I would very much appreciate, if someone can give suggestions to
> implement a loop to generate a string in the following format.
>  Variables with assigned values are given in A:
>  A = {a1:2.0, a2:4.0,………,an:5.0}
>  I want to transform what is in the dictionary into a string in the
> following format:
>  X = 'a1:2.0, a2:4.0, ……,an:5.0'
>  I want to implement a loop to generate X for a given A with varying n.  Is
> there a way to do this in python..?
>
> Thanks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070310/efb69863/attachment.html>


More information about the NumPy-Discussion mailing list