def __init__(self, model, axis, palette):
        """
        Header constructor.

        The 'model' is the QAbstractTableModel of the dataframe, the 'axis' is
        to acknowledge if is for the header (horizontal - 0) or for the
        index (vertical - 1) and the palette is the set of colors to use.
        """
        super(DataFrameHeaderModel, self).__init__()
        self.model = model
        self.axis = axis
        self._palette = palette
        if self.axis == 0:
            self.total_cols = self.model.shape[1]
            self._shape = (self.model.header_shape[0], self.model.shape[1])
            if self.total_cols > LARGE_COLS:
                self.cols_loaded = COLS_TO_LOAD
            else:
                self.cols_loaded = self.total_cols
        else:
            self.total_rows = self.model.shape[0]
            self._shape = (self.model.shape[0], self.model.header_shape[1])
            if self.total_rows > LARGE_NROWS:
                self.rows_loaded = ROWS_TO_LOAD
            else:
                self.rows_loaded = self.total_rows
def __init__ ( self , model , axis , palette ) : super ( DataFrameHeaderModel , self ) . __init__ ( ) self . model = model self . axis = axis self . _palette = palette if self . axis == 0 : self . total_cols = self . model . shape [ 1 ] self . _shape = ( self . model . header_shape [ 0 ] , self . model . shape [ 1 ] ) if self . total_cols > LARGE_COLS : self . cols_loaded = COLS_TO_LOAD else : self . cols_loaded = self . total_cols else : self . total_rows = self . model . shape [ 0 ] self . _shape = ( self . model . shape [ 0 ] , self . model . header_shape [ 1 ] ) if self . total_rows > LARGE_NROWS : self . rows_loaded = ROWS_TO_LOAD else : self . rows_loaded = self . total_rows
Header constructor.

        The 'model' is the QAbstractTableModel of the dataframe, the 'axis' is
        to acknowledge if is for the header (horizontal - 0) or for the
        index (vertical - 1) and the palette is the set of colors to use.