nodes: 0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:self; 6, identifier:columnId; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, expression_statement; 15, identifier:order; 16, attribute; 17, comment:"""
          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
  
          """; 18, call; 19, call; 20, assignment; 21, call; 22, call; 23, call; 24, identifier:Qt; 25, identifier:AscendingOrder; 26, attribute; 27, argument_list; 28, attribute; 29, argument_list; 30, identifier:column; 31, subscript; 32, attribute; 33, argument_list; 34, attribute; 35, argument_list; 36, attribute; 37, argument_list; 38, attribute; 39, identifier:emit; 40, attribute; 41, identifier:emit; 42, attribute; 43, identifier:columnId; 44, attribute; 45, identifier:sort_values; 46, identifier:column; 47, keyword_argument; 48, keyword_argument; 49, attribute; 50, identifier:emit; 51, attribute; 52, identifier:emit; 53, identifier:self; 54, identifier:layoutAboutToBeChanged; 55, identifier:self; 56, identifier:sortingAboutToStart; 57, attribute; 58, identifier:columns; 59, identifier:self; 60, identifier:_dataFrame; 61, identifier:ascending; 62, not_operator; 63, identifier:inplace; 64, True; 65, identifier:self; 66, identifier:layoutChanged; 67, identifier:self; 68, identifier:sortingFinished; 69, identifier:self; 70, identifier:_dataFrame; 71, call; 72, identifier:bool; 73, argument_list; 74, identifier:order
code: def sort(self, columnId, order=Qt.AscendingOrder):
          """
          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
  
          """
          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()