# Buggy code
def get_bgcolor(self, index):
    """Background color depending on value"""
    column = index.column()
    if column == 0:
        color = QColor(Qt.lightGray)
        color.setAlphaF(0.8)
        return color
    if not self.bgcolor_enabled:
        return
    value = self.get_value(index.row(), column - 1)
    if isinstance(value, _sup_com):
        color_func = abs
    else:
        color_func = float
    if isinstance(value, _sup_nr + _sup_com) and self.bgcolor_enabled:
        vmax, vmin = self.return_max(self.max_min_col, column - 1)
        hue = self.hue0 + self.dhue * (vmax - color_func(value)) / (vmax - vmin)
        hue = float(abs(hue))
        if hue > 1:
            hue = 1
        color = QColor.fromHsvF(hue, self.sat, self.val, self.alp)
    elif is_text_string(value):
        color = QColor(Qt.lightGray)
        color.setAlphaF(0.05)
    else:
        color = QColor(Qt.lightGray)
        color.setAlphaF(0.3)
    return color


# 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 get_bgcolor(self, index):
    """Background color depending on value"""
    column = index.column()
    if column == 0:
        color = QColor(BACKGROUND_NONNUMBER_COLOR)
        color.setAlphaF(BACKGROUND_INDEX_ALPHA)
        return color
    if not self.bgcolor_enabled:
        return
    value = self.get_value(index.row(), column - 1)
    if self.max_min_col[column - 1] is None:
        color = QColor(BACKGROUND_NONNUMBER_COLOR)
        if is_text_string(value):
            color.setAlphaF(BACKGROUND_STRING_ALPHA)
        else:
            color.setAlphaF(BACKGROUND_MISC_ALPHA)
    else:
        if isinstance(value, COMPLEX_NUMBER_TYPES):
            color_func = abs
        else:
            color_func = float
        vmax, vmin = self.return_max(self.max_min_col, column - 1)
        hue = BACKGROUND_NUMBER_MINHUE + BACKGROUND_NUMBER_HUERANGE * (
            vmax - color_func(value)
        ) / (vmax - vmin)
        hue = float(abs(hue))
        if hue > 1:
            hue = 1
        color = QColor.fromHsvF(
            hue,
            BACKGROUND_NUMBER_SATURATION,
            BACKGROUND_NUMBER_VALUE,
            BACKGROUND_NUMBER_ALPHA,
        )
    return color