'pandas dataframe adding extra row on all entries after the 1st
When I add entries to my pandas dataframe, it is doing just as I want it to do for the 1st entry, but after that, it is giving an extra row with only 1 of the entries. It doesn't mater what I put in for the field for that entry, the extra row is always the same.
self.df_DT = self.df_DT.append({self.HeaderHourNumber: self.comboBox_DT_Hourly.currentText(),
self.HeaderMainZone: self.comboBox_Main_Zone1.currentText(),
self.HeaderDetailedIssue: self.comboBox_Detail_Issue1.currentText(),
self.HeaderDTmin: self.line_DT_min.text(),
self.HeaderMaintence: self.comboBox_Maint.currentText(),
self.HeaderNotes: self.textEdit_DT_Notes.toPlainText()}, ignore_index=True)
self.df_DT = self.df_DT.sort_values(self.HeaderHourNumber)
self.model_DT = PandasModel(self.df_DT)
self.tableView_DT.setModel(self.model_DT)
When I run it, it gives me this:
Hour Number Main Zone ... Maintence Called? Notes
... No
... No
... No
2 Thiele ... Yes some notes
4 Thiele ... Yes some notes
6 Thiele ... Yes some notes
9 Thiele ... Yes some notes
The 'Maintence Called' section is the only section that has anything in the extra rows and it always says 'No'.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
