Skip to content

Commit

Permalink
Fix the bug when loading Frame when the index is not string format.
Browse files Browse the repository at this point in the history
  • Loading branch information
salan668 committed Feb 17, 2024
1 parent 15943e2 commit d625597
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions BC/DataContainer/DataContainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def Load(self, file_path, is_update=True):
self.__init__()
try:
self._df = pd.read_csv(file_path, header=0, index_col=0).sort_index().sort_index(axis=1)
self._df.index = [str(one) for one in self._df.index]
self._df = self._df.sort_index().sort_index(axis=1)
if is_update:
return self.UpdateDataByFrame()
except Exception as e:
Expand All @@ -137,6 +139,8 @@ def LoadWithoutLabel(self, file_path, is_update=True):
self.__init__()
try:
self._df = pd.read_csv(file_path, header=0, index_col=0).sort_index().sort_index(axis=1)
self._df.index = [str(one) for one in self._df.index]
self._df = self._df.sort_index().sort_index(axis=1)
if is_update:
self.UpdateDataByFrame(emu_label=True)
return True
Expand Down
4 changes: 1 addition & 3 deletions BC/GUI/ModelPredictionForm.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,9 @@ def Save(self):
os.system("explorer.exe {:s}".format(os.path.normpath(store_folder)))




if __name__ == '__main__':
import sys
app = QApplication()
app = QApplication(sys.argv)
frame = ModelPredictionForm()
frame.show()
sys.exit(app.exec_())

0 comments on commit d625597

Please sign in to comment.