# Buggy code
def max_min_col_update(self):
    """Determines the maximum and minimum number in each column"""
    # If there are no rows to compute max/min then return
    if self.df.shape[0] == 0:
        return
    max_r = self.df.max(numeric_only=True)
    min_r = self.df.min(numeric_only=True)
    self.max_min_col = list(zip(max_r, min_r))
    if len(self.max_min_col) != self.df.shape[1]:
        # Then it contain complex numbers or other types
        float_intran = self.df.applymap(lambda e: isinstance(e, _sup_nr))
        self.complex_intran = self.df.applymap(lambda e: isinstance(e, _sup_com))
        mask = float_intran & (~self.complex_intran)
        try:
            df_abs = self.df[self.complex_intran].abs()
        except TypeError:
            df_abs = self.df[self.complex_intran]
        max_c = df_abs.max(skipna=True)
        min_c = df_abs.min(skipna=True)
        df_real = self.df[mask]
        max_r = df_real.max(skipna=True)
        min_r = df_real.min(skipna=True)
        self.max_min_col = list(
            zip(
                DataFrame([max_c, max_r]).max(skipna=True),
                DataFrame([min_c, min_r]).min(skipna=True),
            )
        )
    self.max_min_col = [
        [vmax, vmin - 1] if vmax == vmin else [vmax, vmin]
        for vmax, vmin in self.max_min_col
    ]


# 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 max_min_col_update(self):
    """
    Determines the maximum and minimum number in each column.

    The result is a list whose k-th entry is [vmax, vmin], where vmax and
    vmin denote the maximum and minimum of the k-th column (ignoring NaN).
    This list is stored in self.max_min_col.

    If the k-th column has a non-numerical dtype, then the k-th entry
    is set to None. If the dtype is complex, then compute the maximum and
    minimum of the absolute values. If vmax equals vmin, then vmin is
    decreased by one.
    """
    if self.df.shape[0] == 0:  # If no rows to compute max/min then return
        return
    self.max_min_col = []
    for dummy, col in self.df.iteritems():
        if col.dtype in REAL_NUMBER_TYPES + COMPLEX_NUMBER_TYPES:
            if col.dtype in REAL_NUMBER_TYPES:
                vmax = col.max(skipna=True)
                vmin = col.min(skipna=True)
            else:
                vmax = col.abs().max(skipna=True)
                vmin = col.abs().min(skipna=True)
            if vmax != vmin:
                max_min = [vmax, vmin]
            else:
                max_min = [vmax, vmin - 1]
        else:
            max_min = None
        self.max_min_col.append(max_min)