[Numpy-discussion] Re: Suggestion to show the shape in repr for summarized arrays

2024-10-30 Thread mattip via NumPy-Discussion
We discussed this again and will merge the current version in a few days unless there is more discussion. ___ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.pyth

[Numpy-discussion] Re: Suggestion to show the shape in repr for summarized arrays

2024-10-01 Thread Evgeni Burovski via NumPy-Discussion
I like this, too. And I think the trailing comment, # shape=... is much better, as it gets the best of both worlds: user get the info, and tools which do eval(repr(..)) only need to learn to ignore the comment. For one, numpy's own doctests will keep working with no churn since scipy_doctest handl

[Numpy-discussion] Re: Suggestion to show the shape in repr for summarized arrays

2024-10-01 Thread Evgeni Burovski via NumPy-Discussion
> > Given that we've already chosen to use the fake `shape=...` keyword when > there is a 0-length axis, what do you think we should do, consistency-wise? > > >>> np.empty([10, 0]) > array([], shape=(10, 0), dtype=float64) > > 1. Follow the precedent and use the fake `shape=...` keyword in the > su

[Numpy-discussion] Re: Suggestion to show the shape in repr for summarized arrays

2024-10-01 Thread Robert Kern via NumPy-Discussion
On Tue, Oct 1, 2024 at 9:57 AM Evgeni Burovski via NumPy-Discussion < numpy-discussion@python.org> wrote: > I like this, too. > > And I think the trailing comment, # shape=... is much better, as it gets > the best of both worlds: user get the info, and tools which do > eval(repr(..)) only need to

[Numpy-discussion] Re: Suggestion to show the shape in repr for summarized arrays

2024-09-30 Thread Chris Barker via NumPy-Discussion
I like this. while ideally, eval(repr(an_object)) == object, in practice this is already violated fro large arays -- so other than doctests, this shouldn't cause too many headaches. -CHB On Mon, Sep 30, 2024 at 10:13 AM Marten van Kerkwijk wrote: > Hi All, > > When the repr of an array is sho