[Numpy-discussion] Arrays and format()

Nathan Goldbaum nathan12343 at gmail.com
Tue Feb 28 12:38:02 EST 2017


See this issue:

https://github.com/numpy/numpy/issues/5543

There was also a very thorough discussion of this recently on this mailing
list:

http://numpy-discussion.10968.n7.nabble.com/Proposal-to-support-format-td43931.html

On Tue, Feb 28, 2017 at 11:32 AM Ryan May <rmay31 at gmail.com> wrote:

> Hi,
>
> Can someone take a look at: https://github.com/numpy/numpy/issues/7978
>
> The crux of the issue is that this:
>
> # This works
> a = "%0.3g" % np.array(2)
> a
> '2'
>
> # This does not
> a = "{0:0.3g}".format(np.array(2))
> TypeError: non-empty format string passed to object.__format__
>
> I've now hit this in my code. If someone can even point me in the general
> direction of the code to dig into for this (please let it be python, please
> let it be python...), I'll dig in more.
>
> Ryan
>
> --
> Ryan May
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20170228/3c4577f8/attachment.html>


More information about the NumPy-Discussion mailing list