How to display a sparse array on the REPL?

The REPL calls display(a), which calls show(stdout, , "text/plain", a) (more precisely, it wraps stdout in an IOContext that limits output.

So, in your script you can either call display(a) or call show(io, "text/plain", a) if you want to output to a particular io stream.

1 Like