PyQt - Implement a QAbstractTableModel for display in QTableView

前端 未结 3 991
盖世英雄少女心
盖世英雄少女心 2021-02-07 08:48

I would like to display a pandas data frame in a PyQt table. I have made some progress with this, but have not been able to correctly derive the Table Model class. Any help with

3条回答
  •  不知归路
    2021-02-07 09:13

    Pandas 0.13 provides as an experimental feature:

    PySide support for the qtpandas DataFrameModel and DataFrameWidget

    see https://github.com/pydata/pandas/blob/master/doc/source/faq.rst

    you can add this feature using

    from pandas.sandbox.qtpandas import DataFrameModel, DataFrameWidget
    

提交回复
热议问题