Add category column if it does not exist

This commit is contained in:
Andreas Tsouchlos 2024-01-04 03:19:30 +01:00
parent 8a0d7f748f
commit 0816ebd26b

View File

@ -121,6 +121,9 @@ class MainWindow(QMainWindow):
self._warnings.append((layout, warningIcon, label))
def set_statement_data(self, df: pd.DataFrame):
if 'category' not in df.columns:
df['category'] = [' '] * len(df.index)
model = PandasModel(df)
proxyModel = QSortFilterProxyModel(self)
proxyModel.setSourceModel(model)