@@ -2080,14 +2080,6 @@ def test_constructor_series_copy(self, float_frame):
2080
2080
2081
2081
assert not (series ["A" ] == 5 ).all ()
2082
2082
2083
- def test_object_array_does_not_copy (self ):
2084
- a = np .array (["a" , "b" ], dtype = "object" )
2085
- b = np .array ([["a" , "b" ], ["c" , "d" ]], dtype = "object" )
2086
- df = DataFrame (a )
2087
- assert np .shares_memory (df .values , a )
2088
- df2 = DataFrame (b )
2089
- assert np .shares_memory (df2 .values , b )
2090
-
2091
2083
def test_constructor_with_nas (self ):
2092
2084
# GH 5016
2093
2085
# na's in indices
@@ -2876,3 +2868,13 @@ def test_tzaware_data_tznaive_dtype(self, constructor):
2876
2868
2877
2869
assert np .all (result .dtypes == "M8[ns]" )
2878
2870
assert np .all (result == ts_naive )
2871
+
2872
+ def test_1d_object_array_does_not_copy (self ):
2873
+ a = np .array (["a" , "b" ], dtype = "object" )
2874
+ df = DataFrame (a , copy = False )
2875
+ assert np .shares_memory (df .values , a )
2876
+
2877
+ def test_2d_object_array_does_not_copy (self ):
2878
+ b = np .array ([["a" , "b" ], ["c" , "d" ]], dtype = "object" )
2879
+ df2 = DataFrame (b , copy = False )
2880
+ assert np .shares_memory (df2 .values , b )
0 commit comments