code: def sort(self, columnId, order=Qt.AscendingOrder):
          
          self.layoutAboutToBeChanged.emit()
          self.sortingAboutToStart.emit()
          column = self._dataFrame.columns[columnId]
          self._dataFrame.sort_values(column, ascending=not bool(order), inplace=True)
          self.layoutChanged.emit()
          self.sortingFinished.emit()
docs: Sorts the model column
  
          After sorting the data in ascending or descending order, a signal
          `layoutChanged` is emitted.
  
          :param: columnId (int)
              the index of the column to sort on.
          :param: order (Qt::SortOrder, optional)
              descending(1) or ascending(0). defaults to Qt.AscendingOrder