def __delitem__(self, key):
deleted = False<EOL>maybe_shortcut = False<EOL>if hasattr(self, '<STR_LIT>') and isinstance(self.columns, MultiIndex):<EOL><INDENT>try:<EOL><INDENT>maybe_shortcut = key not in self.columns._engine<EOL><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if maybe_shortcut:<EOL><INDENT>if not isinstance(key, tuple):<EOL><INDENT>key = (key, )<EOL><DEDENT>for col in self.columns:<EOL><INDENT>if isinstance(col, tuple) and col[:len(key)] == key:<EOL><INDENT>del self[col]<EOL>deleted = True<EOL><DEDENT><DEDENT><DEDENT>if not deleted:<EOL><INDENT>self._data.delete(key)<EOL><DEDENT>try:<EOL><INDENT>del self._item_cache[key]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>
Delete item