Hello,

I wanted to discuss a pain point I've experienced while debugging numpy
code. When dealing with e.g. transformed image arrays or other non-trivial
ndarrays in debugger, I'm swamped by a bunch of numbers in their repr that
don't help me at all. What I really care about is *shape and dtype*, as
they are essentially what distinguishes complete type of numpy arrays.

Example of not helpful output:
```
array([[[0.49113064, 0.42102904, 0.62108876],
        [0.25435884, 0.18665439, 0.53790145],
```

By counting the [ brackets, I can at least get the number of dimensions,
but usefulness stops here.

Could repr of an array start with something like:
`array(*shape=[32,32,3], dtype=float, data=*([[[0.49113064, ...)`

I know one invariant that repr likes to keep is that you can post repr and
it should be the initialisation of the represented object, but given that
we replace long number sequence with ..., this is already not the case.

Short term: Perhaps a plugin / change to IDE could do what I ask, please
let me know if something like this already exists :)

Long term: I think that behavior will be more useful than what is currently
there. It could also be conditionally there once we anyhow need to use ...
for too long arrays.

Best Regards,
--
Ilya Kamen
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to