Skip to content

Commit cf2abfd

Browse files
committed
FIX: replaces ndim check with ABC subclass check
1 parent 0be7b57 commit cf2abfd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: pandas/core/generic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
pandas_dtype)
2929
from pandas.core.dtypes.cast import maybe_promote, maybe_upcast_putmask
3030
from pandas.core.dtypes.missing import isnull, notnull
31-
from pandas.core.dtypes.generic import ABCSeries, ABCPanel
31+
from pandas.core.dtypes.generic import ABCSeries, ABCPanel, ABCDataFrame
3232

3333
from pandas.core.common import (_values_from_object,
3434
_maybe_box_datetimelike,
@@ -3278,7 +3278,7 @@ def __setattr__(self, name, value):
32783278
else:
32793279
object.__setattr__(self, name, value)
32803280
except (AttributeError, TypeError):
3281-
if (self.ndim > 1) and (is_list_like(value)):
3281+
if isinstance(self, ABCDataFrame) and (is_list_like(value)):
32823282
warnings.warn("Pandas doesn't allow Series to be assigned "
32833283
"into nonexistent columns - see "
32843284
"https://pandas.pydata.org/pandas-docs/"

0 commit comments

Comments
 (0)