CategoryModel
Sub classes¶
| Name | Children | Inherits |
|---|---|---|
| PandasCategoryListModel cutepandas.pandasmodels.pandascategorylistmodel `CategoryModel` for a pandas `category` column that also edits it. |
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| TranslatableHeaderMixin cutepandas.utils.i18n Item model mixin: horizontal header labels from `HEADER`, translated. |
||
| DataFrameHolderMixin cutepandas.pandasmodels.dataframeholder Model mixin: keeps `self.df` in a (possibly shared) DataFrameHolder. |
||
| ModelMixin prettyqt.itemmodels.modelmixin |
||
| AbstractTableModel prettyqt.core.abstracttablemodel Abstract model that can be subclassed to create table models. |
⋔ Inheritance diagram¶
graph TD
2298428083["categorymodel.CategoryModel"]
1559661765["i18n.TranslatableHeaderMixin"]
3771062457["i18n.TranslateMixin"]
2751680898["builtins.object"]
103874424["dataframeholder.DataFrameHolderMixin"]
3514613245["itemmodels.ModelMixin"]
656210031["core.AbstractTableModel"]
4092674192["core.AbstractTableModelMixin"]
3882849576["core.AbstractItemModelMixin"]
3227531497["core.ObjectMixin"]
1115338939["QtCore.QAbstractTableModel"]
930985301["QtCore.QAbstractItemModel"]
13951691["QtCore.QObject"]
395147830["sip.wrapper"]
46922758["sip.simplewrapper"]
1559661765 --> 2298428083
3771062457 --> 1559661765
2751680898 --> 3771062457
103874424 --> 2298428083
2751680898 --> 103874424
3514613245 --> 2298428083
2751680898 --> 3514613245
656210031 --> 2298428083
4092674192 --> 656210031
3882849576 --> 4092674192
3227531497 --> 3882849576
2751680898 --> 3227531497
1115338939 --> 656210031
930985301 --> 1115338939
13951691 --> 930985301
395147830 --> 13951691
46922758 --> 395147830
2751680898 --> 46922758
🛈 DocStrings¶
Bases: TranslatableHeaderMixin, DataFrameHolderMixin, ModelMixin, AbstractTableModel
One row per category of a column, with its code and number of rows, read-only.
Works for pandas category and dictionary-encoded pd.ArrowDtype columns, polars
Enum (fixed categories) and Categorical (the values present), and pyarrow
dictionary columns. Other columns show no rows. Categories and counts are computed
once per frame (one value_counts scan).
Source code in src/cutepandas/pandasmodels/categorymodel.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
__init__
¶
Show the categories of column col (a label).
translate maps the English labels (header, tooltip) to the shown text.