# Buggy code
def setData(self, index, value, role=Qt.EditRole, change_type=None):
    """Cell content change"""
    column = index.column()
    row = index.row()

    if change_type is not None:
        try:
            value = self.data(index, role=Qt.DisplayRole)
            val = from_qvariant(value, str)
            if change_type is bool:
                val = bool_false_check(val)
            self.df.iloc[row, column - 1] = change_type(val)
        except ValueError:
            self.df.iloc[row, column - 1] = change_type("0")
    else:
        val = from_qvariant(value, str)
        current_value = self.get_value(row, column - 1)
        if isinstance(current_value, bool):
            val = bool_false_check(val)
        if isinstance(current_value, ((bool,) + _sup_nr + _sup_com)) or is_text_string(
            current_value
        ):
            try:
                self.df.iloc[row, column - 1] = current_value.__class__(val)
            except ValueError as e:
                QMessageBox.critical(self.dialog, "Error", "Value error: %s" % str(e))
                return False
        else:
            QMessageBox.critical(
                self.dialog, "Error", "The type of the cell is not a supported type"
            )
            return False
    self.max_min_col_update()
    return True


# 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 setData(self, index, value, role=Qt.EditRole, change_type=None):
    """Cell content change"""
    column = index.column()
    row = index.row()

    if change_type is not None:
        try:
            value = self.data(index, role=Qt.DisplayRole)
            val = from_qvariant(value, str)
            if change_type is bool:
                val = bool_false_check(val)
            self.df.iloc[row, column - 1] = change_type(val)
        except ValueError:
            self.df.iloc[row, column - 1] = change_type("0")
    else:
        val = from_qvariant(value, str)
        current_value = self.get_value(row, column - 1)
        if isinstance(current_value, bool):
            val = bool_false_check(val)
        supported_types = (bool,) + REAL_NUMBER_TYPES + COMPLEX_NUMBER_TYPES
        if isinstance(current_value, supported_types) or is_text_string(current_value):
            try:
                self.df.iloc[row, column - 1] = current_value.__class__(val)
            except ValueError as e:
                QMessageBox.critical(self.dialog, "Error", "Value error: %s" % str(e))
                return False
        else:
            QMessageBox.critical(
                self.dialog, "Error", "The type of the cell is not a supported type"
            )
            return False
    self.max_min_col_update()
    return True