Add category column if it does not exist
This commit is contained in:
parent
8a0d7f748f
commit
0816ebd26b
@ -121,6 +121,9 @@ class MainWindow(QMainWindow):
|
|||||||
self._warnings.append((layout, warningIcon, label))
|
self._warnings.append((layout, warningIcon, label))
|
||||||
|
|
||||||
def set_statement_data(self, df: pd.DataFrame):
|
def set_statement_data(self, df: pd.DataFrame):
|
||||||
|
if 'category' not in df.columns:
|
||||||
|
df['category'] = [' '] * len(df.index)
|
||||||
|
|
||||||
model = PandasModel(df)
|
model = PandasModel(df)
|
||||||
proxyModel = QSortFilterProxyModel(self)
|
proxyModel = QSortFilterProxyModel(self)
|
||||||
proxyModel.setSourceModel(model)
|
proxyModel.setSourceModel(model)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user