Cell Output Line Length in Editor View #10608
Replies: 1 comment 1 reply
|
For the NumPy arrays in your screenshot, the setting is NumPy's 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 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 For the separate metadata question: “top of your notebook” means the top of the saved # /// script
# [tool.marimo.formatting]
# line_length = 128
# ///
import marimo
# Keep the rest of your existing notebook here.Keep the I checked the array examples and metadata loading with marimo 0.24.2 on Python 3.10/NumPy 2.2.6 and Python 3.12/NumPy 2.5.3, including exporting a notebook with both outputs. |


For the NumPy arrays in your screenshot, the setting is NumPy's
linewidth. Put this in one marimo cell:NumPy's default is 75 characters. It inserts breaks between elements, and
print(array)and the displayedarray(...)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:
The marimo
formatting.line_lengthoption…