@@ -180,24 +180,24 @@ def test_datetimelike_values_with_object_dtype(self, kind, frame_or_series):
180
180
arr = arr [:, 0 ]
181
181
182
182
obj = frame_or_series (arr , dtype = object )
183
- assert obj ._mgr .arrays [0 ].dtype == object
184
- assert isinstance (obj ._mgr .arrays [0 ].ravel ()[0 ], scalar_type )
183
+ assert obj ._mgr .blocks [0 ]. values .dtype == object
184
+ assert isinstance (obj ._mgr .blocks [0 ]. values .ravel ()[0 ], scalar_type )
185
185
186
186
# go through a different path in internals.construction
187
187
obj = frame_or_series (frame_or_series (arr ), dtype = object )
188
- assert obj ._mgr .arrays [0 ].dtype == object
189
- assert isinstance (obj ._mgr .arrays [0 ].ravel ()[0 ], scalar_type )
188
+ assert obj ._mgr .blocks [0 ]. values .dtype == object
189
+ assert isinstance (obj ._mgr .blocks [0 ]. values .ravel ()[0 ], scalar_type )
190
190
191
191
obj = frame_or_series (frame_or_series (arr ), dtype = NumpyEADtype (object ))
192
- assert obj ._mgr .arrays [0 ].dtype == object
193
- assert isinstance (obj ._mgr .arrays [0 ].ravel ()[0 ], scalar_type )
192
+ assert obj ._mgr .blocks [0 ]. values .dtype == object
193
+ assert isinstance (obj ._mgr .blocks [0 ]. values .ravel ()[0 ], scalar_type )
194
194
195
195
if frame_or_series is DataFrame :
196
196
# other paths through internals.construction
197
197
sers = [Series (x ) for x in arr ]
198
198
obj = frame_or_series (sers , dtype = object )
199
- assert obj ._mgr .arrays [0 ].dtype == object
200
- assert isinstance (obj ._mgr .arrays [0 ].ravel ()[0 ], scalar_type )
199
+ assert obj ._mgr .blocks [0 ]. values .dtype == object
200
+ assert isinstance (obj ._mgr .blocks [0 ]. values .ravel ()[0 ], scalar_type )
201
201
202
202
def test_series_with_name_not_matching_column (self ):
203
203
# GH#9232
@@ -297,7 +297,7 @@ def test_constructor_dtype_nocast_view_dataframe(self):
297
297
def test_constructor_dtype_nocast_view_2d_array (self ):
298
298
df = DataFrame ([[1 , 2 ], [3 , 4 ]], dtype = "int64" )
299
299
df2 = DataFrame (df .values , dtype = df [0 ].dtype )
300
- assert df2 ._mgr .arrays [0 ].flags .c_contiguous
300
+ assert df2 ._mgr .blocks [0 ]. values .flags .c_contiguous
301
301
302
302
@pytest .mark .xfail (using_pyarrow_string_dtype (), reason = "conversion copies" )
303
303
def test_1d_object_array_does_not_copy (self ):
@@ -2493,27 +2493,27 @@ def get_base(obj):
2493
2493
def check_views (c_only : bool = False ):
2494
2494
# Check that the underlying data behind df["c"] is still `c`
2495
2495
# after setting with iloc. Since we don't know which entry in
2496
- # df._mgr.arrays corresponds to df["c"], we just check that exactly
2496
+ # df._mgr.blocks corresponds to df["c"], we just check that exactly
2497
2497
# one of these arrays is `c`. GH#38939
2498
- assert sum (x is c for x in df ._mgr .arrays ) == 1
2498
+ assert sum (x . values is c for x in df ._mgr .blocks ) == 1
2499
2499
if c_only :
2500
2500
# If we ever stop consolidating in setitem_with_indexer,
2501
2501
# this will become unnecessary.
2502
2502
return
2503
2503
2504
2504
assert (
2505
2505
sum (
2506
- get_base (x ) is a
2507
- for x in df ._mgr .arrays
2508
- if isinstance (x .dtype , np .dtype )
2506
+ get_base (x . values ) is a
2507
+ for x in df ._mgr .blocks
2508
+ if isinstance (x .values . dtype , np .dtype )
2509
2509
)
2510
2510
== 1
2511
2511
)
2512
2512
assert (
2513
2513
sum (
2514
- get_base (x ) is b
2515
- for x in df ._mgr .arrays
2516
- if isinstance (x .dtype , np .dtype )
2514
+ get_base (x . values ) is b
2515
+ for x in df ._mgr .blocks
2516
+ if isinstance (x .values . dtype , np .dtype )
2517
2517
)
2518
2518
== 1
2519
2519
)
@@ -3045,7 +3045,7 @@ def test_construction_from_ndarray_datetimelike(self):
3045
3045
# constructed from 2D ndarray
3046
3046
arr = np .arange (0 , 12 , dtype = "datetime64[ns]" ).reshape (4 , 3 )
3047
3047
df = DataFrame (arr )
3048
- assert all (isinstance (arr , DatetimeArray ) for arr in df ._mgr .arrays )
3048
+ assert all (isinstance (block . values , DatetimeArray ) for block in df ._mgr .blocks )
3049
3049
3050
3050
def test_construction_from_ndarray_with_eadtype_mismatched_columns (self ):
3051
3051
arr = np .random .default_rng (2 ).standard_normal ((10 , 2 ))
0 commit comments