File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 87
87
88
88
if TYPE_CHECKING :
89
89
from collections .abc import (
90
+ Iterable ,
90
91
Sequence ,
91
- Sized ,
92
92
)
93
93
94
94
from pandas ._typing import (
@@ -1581,7 +1581,7 @@ def _maybe_box_and_unbox_datetimelike(value: Scalar, dtype: DtypeObj):
1581
1581
return _maybe_unbox_datetimelike (value , dtype )
1582
1582
1583
1583
1584
- def construct_1d_object_array_from_listlike (values : Sized ) -> np .ndarray :
1584
+ def construct_1d_object_array_from_listlike (values : Iterable ) -> np .ndarray :
1585
1585
"""
1586
1586
Transform any list-like object in a 1-dimensional numpy array of object
1587
1587
dtype.
@@ -1602,7 +1602,8 @@ def construct_1d_object_array_from_listlike(values: Sized) -> np.ndarray:
1602
1602
# numpy will try to interpret nested lists as further dimensions, hence
1603
1603
# making a 1D array that contains list-likes is a bit tricky:
1604
1604
result = np .empty (len (values ), dtype = "object" )
1605
- result [:] = values
1605
+ for i , obj in enumerate (values ):
1606
+ result [i ] = obj
1606
1607
return result
1607
1608
1608
1609
You can’t perform that action at this time.
0 commit comments