Skip to content

Commit 7efafa6

Browse files
committed
use to_numpy
1 parent 1f8e540 commit 7efafa6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/core/indexes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def __new__(cls, data=None, dtype=None, copy=False, name=None,
266266
from .range import RangeIndex
267267
if isinstance(data, ABCPandasArray):
268268
# ensure users don't accidentally put a PandasArray in an index.
269-
data = data._ndarray
269+
data = data.to_numpy()
270270

271271
# range
272272
if isinstance(data, RangeIndex):

pandas/core/internals/construction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ def sanitize_array(data, index, dtype=None, copy=False,
582582
# We don't want to let people put our PandasArray wrapper
583583
# (the output of Series/Index.array), into a Series. So
584584
# we explicitly unwrap it here.
585-
subarr = data._ndarray
585+
subarr = data.to_numpy()
586586
else:
587587
subarr = data
588588

0 commit comments

Comments
 (0)