Skip to content

IndexDescriptionColumn

Base classes

Name Children Inherits
ColumnItem
prettyqt.itemmodels.columnitemmodel
Determines how an object attribute is shown.

⋔ Inheritance diagram

graph TD
  2136229562["dataframelistwidget.IndexDescriptionColumn"]
  2335430101["itemmodels.ColumnItem"]
  2751680898["builtins.object"]
  2335430101 --> 2136229562
  2751680898 --> 2335430101

🛈 DocStrings

Bases: ColumnItem

Source code in src/cutepandas/pandaswidgets/dataframelistwidget.py
class IndexDescriptionColumn(itemmodels.ColumnItem):
    name = "Index"

    def get_data(self, item, role):
        match role:
            case constants.DISPLAY_ROLE:
                if isinstance(item.index, pd.MultiIndex):
                    return f"MultiIndex ({len(item.index.levels)})"
                return str(item.index.name)

:fa-brands-github: Show source on GitHub