Re: [Numpy-discussion] Arrays and format()

2017-02-28 Thread Ryan May
Gustav, I had seen this discussion, but completely blanked when I posted my problem. I looked over the proposal and nothing jumped out at me on a quick read-through; it seemed straightforward and would meet my needs. I'll try to carve out some time to think a bit more about it and let you know i

Re: [Numpy-discussion] Arrays and format()

2017-02-28 Thread Gustav Larsson
I am hoping to submit a PR for a __format__ numpy enhancement proposal this weekend. I will be a slightly revised version of my original draft posted here two weeks ago. Ryan, if you have any thoughts on the writeup so far, I'd lov

Re: [Numpy-discussion] Arrays and format()

2017-02-28 Thread Nathan Goldbaum
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 wrote: > Hi, > > Can someon

[Numpy-discussion] Arrays and format()

2017-02-28 Thread Ryan May
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