[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

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

2024-09-30 Thread Marten van Kerkwijk
Hi All, When the repr of an array is shown, currently the dtype and shape are explicitly listed if these cannot be directly inferred from the list that is shown, i.e., if the dtype is not float64 or int64, and if the size of the array is zero, but the shape not the simple (0,). For instance, ```