# Buggy code
def __init__(self, dataFrame, format="%.3g", parent=None):
    QAbstractTableModel.__init__(self)
    self.dialog = parent
    self.df = dataFrame
    self.df_index = dataFrame.index.tolist()
    self.df_header = dataFrame.columns.tolist()
    self._format = format
    self.complex_intran = None

    self.total_rows = self.df.shape[0]
    self.total_cols = self.df.shape[1]
    size = self.total_rows * self.total_cols

    huerange = [0.66, 0.99]  # Hue
    self.sat = 0.7  # Saturation
    self.val = 1.0  # Value
    self.alp = 0.6  # Alpha-channel
    self.hue0 = huerange[0]
    self.dhue = huerange[1] - huerange[0]
    self.max_min_col = None
    if size < LARGE_SIZE:
        self.max_min_col_update()
        self.colum_avg_enabled = True
        self.bgcolor_enabled = True
        self.colum_avg(1)
    else:
        self.colum_avg_enabled = False
        self.bgcolor_enabled = False
        self.colum_avg(0)

    # Use paging when the total size, number of rows or number of
    # columns is too large
    if size > LARGE_SIZE:
        self.rows_loaded = self.ROWS_TO_LOAD
        self.cols_loaded = self.COLS_TO_LOAD
    else:
        if self.total_rows > LARGE_NROWS:
            self.rows_loaded = self.ROWS_TO_LOAD
        else:
            self.rows_loaded = self.total_rows
        if self.total_cols > LARGE_COLS:
            self.cols_loaded = self.COLS_TO_LOAD
        else:
            self.cols_loaded = self.total_cols


# Traceback (ValueError)
Traceback (most recent call last):
File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\variableexplorer\collectionseditor.py", line 464, in createEditor
if not editor.setup_and_check(value, title=key):
File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\variableexplorer\dataframeeditor.py", line 523, in setup_and_check
self.dataModel = DataFrameModel(data, parent=self)
File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\variableexplorer\dataframeeditor.py", line 93, in __init__
self.max_min_col_update()
File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\variableexplorer\dataframeeditor.py", line 132, in max_min_col_update
df_abs = self.df[self.complex_intran].abs()
File "C:\Anaconda2\lib\site-packages\pandas\core\frame.py", line 1993, in __getitem__
return self._getitem_frame(key)
File "C:\Anaconda2\lib\site-packages\pandas\core\frame.py", line 2069, in _getitem_frame
return self.where(key)
File "C:\Anaconda2\lib\site-packages\pandas\core\generic.py", line 4491, in where
transpose=self._AXIS_REVERSED)
File "C:\Anaconda2\lib\site-packages\pandas\core\internals.py", line 2908, in where
return self.apply('where', **kwargs)
File "C:\Anaconda2\lib\site-packages\pandas\core\internals.py", line 2890, in apply
applied = getattr(b, f)(**kwargs)
File "C:\Anaconda2\lib\site-packages\pandas\core\internals.py", line 1240, in where
return self.make_block(result)
File "C:\Anaconda2\lib\site-packages\pandas\core\internals.py", line 181, in make_block
return make_block(values, placement=placement, ndim=ndim, **kwargs)
File "C:\Anaconda2\lib\site-packages\pandas\core\internals.py", line 2518, in make_block
return klass(values, ndim=ndim, fastpath=fastpath, placement=placement)
File "C:\Anaconda2\lib\site-packages\pandas\core\internals.py", line 1663, in __init__
placement=placement, **kwargs)
File "C:\Anaconda2\lib\site-packages\pandas\core\internals.py", line 81, in __init__
raise ValueError('Wrong number of dimensions')
ValueError: Wrong number of dimensions

# Fixed code
def __init__(self, dataFrame, format="%.3g", parent=None):
    QAbstractTableModel.__init__(self)
    self.dialog = parent
    self.df = dataFrame
    self.df_index = dataFrame.index.tolist()
    self.df_header = dataFrame.columns.tolist()
    self._format = format
    self.complex_intran = None

    self.total_rows = self.df.shape[0]
    self.total_cols = self.df.shape[1]
    size = self.total_rows * self.total_cols

    self.max_min_col = None
    if size < LARGE_SIZE:
        self.max_min_col_update()
        self.colum_avg_enabled = True
        self.bgcolor_enabled = True
        self.colum_avg(1)
    else:
        self.colum_avg_enabled = False
        self.bgcolor_enabled = False
        self.colum_avg(0)

    # Use paging when the total size, number of rows or number of
    # columns is too large
    if size > LARGE_SIZE:
        self.rows_loaded = self.ROWS_TO_LOAD
        self.cols_loaded = self.COLS_TO_LOAD
    else:
        if self.total_rows > LARGE_NROWS:
            self.rows_loaded = self.ROWS_TO_LOAD
        else:
            self.rows_loaded = self.total_rows
        if self.total_cols > LARGE_COLS:
            self.cols_loaded = self.COLS_TO_LOAD
        else:
            self.cols_loaded = self.total_cols