Skip to content
Discussion options

You must be logged in to vote

For the NumPy arrays in your screenshot, the setting is NumPy's linewidth. Put this in one marimo cell:

import numpy as np

np.set_printoptions(linewidth=128)
print(np.arange(100))
np.arange(40)

NumPy's default is 75 characters. It inserts breaks between elements, and print(array) and the displayed array(...) representation have different punctuation and indentation. That explains the 72/74-character lines in your example. With the code above, both examples have a 126-character first line. NumPy print options.

For a single print without changing subsequent NumPy output, you can instead use:

print(np.array2string(np.arange(100), max_line_width=128))

The marimo formatting.line_length option…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@NorthernBusinessGoose
Comment options

Answer selected by NorthernBusinessGoose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants