import numpy as np import panel as pn pn.extension()
ArrayInput widget allows rendering and editing NumPy arrays using a text entry box whose contents are then parsed in Python. In order to avoid issues with large arrays the
ArrayInput defines a
max_array_size, if the array exceeds this size the textual representation will be summarized and editing will be disbaled.
For layout and styling related parameters see the customization user guide.
value: Parsed value of the indicated type
disabled(boolean): Whether the widget is editable
name(str): The title of the widget
placeholder(str): A placeholder string displayed when no value is entered
array_input = pn.widgets.ArrayInput(name='Array Input ', value=np.random.randint(0, 10, (10, 2))) array_input
ArrayInput.value returns a value of the evaluated type that can be read out and set like other widgets:
array([[6, 8], [3, 0], [1, 1], [6, 0], [8, 3], [4, 2], [0, 4], [3, 3], [0, 0], [8, 8]])