Skip to content

Commit 93f57e9

Browse files
authored
CLN: lighter-weight casting (#38377)
1 parent 6b5357a commit 93f57e9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/core/construction.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,7 @@ def sanitize_array(
520520

521521
# a 1-element ndarray
522522
if len(subarr) != len(index) and len(subarr) == 1:
523-
subarr = construct_1d_arraylike_from_scalar(
524-
subarr[0], len(index), subarr.dtype
525-
)
523+
subarr = subarr.repeat(len(index))
526524

527525
elif subarr.ndim > 1:
528526
if isinstance(data, np.ndarray):

0 commit comments

Comments
 (0)