Skip to content

Commit e04c4e8

Browse files
committed
if check more generic
1 parent 28fd9e9 commit e04c4e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/construction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ def sanitize_array(
597597
# create an extension array from its dtype
598598
_sanitize_non_ordered(data)
599599
cls = dtype.construct_array_type()
600-
if isinstance(data, KeysView):
600+
if not hasattr(data, "__array__"):
601601
data = list(data)
602602
subarr = cls._from_sequence(data, dtype=dtype, copy=copy)
603603

0 commit comments

Comments
 (0)