traitsui.ui_editors.data_frame_editor module

class traitsui.ui_editors.data_frame_editor.DataFrameAdapter[source]

Bases: TabularAdapter

Generic tabular adapter for data frames

alignment = Property(Enum("left", "center", "right"))

The alignment for each cell

delete(object, trait, row)[source]

Override the base implementation to work with DataFrames

Unavoidably does a copy of the data, setting the trait with the new value.

font = Property()

The font to use for each column

format = Property()

The format to use for each column

get_item(object, trait, row)[source]

Override the base implementation to work with DataFrames

This returns a dataframe with one row, rather than a series, since using a dataframe preserves dtypes.

index_alignment = Property()

The alignment to use for a row index.

index_text = Property()

The text to use for a row index.

insert(object, trait, row, value)[source]

Override the base implementation to work with DataFrames

Unavoidably does a copy of the data, setting the trait with the new value.

text = Property()

The text to use for a generic entry.

class traitsui.ui_editors.data_frame_editor.DataFrameEditor(*args, **traits)[source]

Bases: BasicEditorFactory

Editor factory for basic data frame editor

activated = Str()

The optional extended name of the trait to synchronize the activated value with:

activated_row = Str()

The optional extended name of the trait to synchronize the activated value’s row with:

adapter = Instance(DataFrameAdapter)

Set to override the default dataframe adapter

clicked = Str()

The optional extended name of the trait to synchronize left click data with. The data is a TabularEditorEvent:

column_clicked = Str()

The optional extended name of the trait to synchronize column clicked data with. The data is a TabularEditorEvent:

column_right_clicked = Str()

The optional extended name of the trait to synchronize column right clicked data with. The data is a TabularEditorEvent:

columns = List(Union(Str, Tuple(Str, Str)))

Optional list of either column ID or pairs of (column title, column ID).

dclicked = Str()

The optional extended name of the trait to synchronize left double click data with. The data is a TabularEditorEvent:

editable = Bool(False)

Whether or not the entries can be edited.

fonts = Union(Font, Dict, default_value="Courier 10")

The font for each element, or a mapping column ID to font.

formats = Union(Str, Dict, default_value="%s")

The format for each element, or a mapping column ID to format.

klass = Property()

The editor implementation class.

multi_select = Bool(False)

Whether or not to allow for multiple selections

operations = List(

What type of operations are allowed on the list:

refresh = Str()

The optional extended name of the trait used to indicate that the table just needs to be repainted.

right_clicked = Str()

The optional extended name of the trait to synchronize right click data with. The data is a TabularEditorEvent:

right_dclicked = Str()

The optional extended name of the trait to synchronize right double clicked data with. The data is a TabularEditorEvent:

scroll_to_column = Str()

The optional extended name of the Event trait that should be used to trigger a scroll-to command. The data is an integer giving the column.

scroll_to_position_hint = Enum("visible", "center", "top", "bottom")

(replacement of scroll_to_row_hint, but more clearly named) Controls behavior of scroll to row and scroll to column

scroll_to_row = Str()

The optional extended name of the Event trait that should be used to trigger a scroll-to command. The data is an integer giving the row.

scroll_to_row_hint = Property(Str, observe="scroll_to_position_hint")

Deprecated: Controls behavior of scroll to row and scroll to column

selectable = Bool(True)

Whether or not to allow selection.

selected = Str()

The optional extended name of the trait to synchronize the selection values with:

selected_row = Str()

The optional extended name of the trait to synchronize the selection rows with:

show_index = Bool(True)

Should an index column be displayed.

show_titles = Bool(True)

Should column headers be displayed.

update = Str()

The optional extended name of the trait used to indicate that a complete table update is needed: