File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ def _clear_item_cache(self):
291
291
self ._item_cache .clear ()
292
292
293
293
def _set_item (self , key , value ):
294
- if isinstance (self .columns , MultiIndex ):
294
+ if hasattr ( self , 'columns' ) and isinstance (self .columns , MultiIndex ):
295
295
# Pad the key with empty strings if lower levels of the key
296
296
# aren't specified:
297
297
if not isinstance (key , tuple ):
@@ -310,7 +310,9 @@ def __delitem__(self, key):
310
310
Delete item
311
311
"""
312
312
deleted = False
313
- if isinstance (self .columns , MultiIndex ) and key not in self .columns :
313
+ if (hasattr (self ,'columns' ) and
314
+ isinstance (self .columns , MultiIndex )
315
+ and key not in self .columns ):
314
316
# Allow shorthand to delete all columns whose first len(key)
315
317
# elements match key:
316
318
if not isinstance (key ,tuple ):
You can’t perform that action at this time.
0 commit comments