i investigating dataframeeditor
in traitsui. came across odd behaviour , hoped confirm and/or offer solution.
if run minimal example below:
import numpy np import pandas pd traits.api import hasstricttraits, instance, button traitsui.api import view, item, vgroup traitsui.ui_editors.data_frame_editor import dataframeeditor class foo(hasstricttraits): do_it = button(label='do it') data = instance('pandas.core.frame.dataframe') view = view( vgroup( item('data', show_label=false, editor=dataframeeditor(editable=true)), item('do_it', show_label=false) ) ) def _data_default(self): return pd.dataframe() def _do_it_fired(self): self.data = pd.dataframe({'a': np.arange(5), 'b': np.arange(5)}) if __name__=='__main__': f = foo() f.configure_traits()
then first time hit do it
button see index of dataframe:
which not right. if close window , re-run e.configure_traits()
see full dataframe expected:
is bug? doing wrong?
Comments
Post a Comment