@@ -214,10 +214,9 @@ def test_repr_truncation(self):
214
214
{
215
215
"A" : np .random .default_rng (2 ).standard_normal (10 ),
216
216
"B" : [
217
- tm .rands (
218
- np .random .default_rng (2 ).integers (max_len - 1 , max_len + 1 )
219
- )
220
- for i in range (10 )
217
+ "a"
218
+ * np .random .default_rng (2 ).integers (max_len - 1 , max_len + 1 )
219
+ for _ in range (10 )
221
220
],
222
221
}
223
222
)
@@ -1177,7 +1176,7 @@ def test_wide_repr(self):
1177
1176
20 ,
1178
1177
):
1179
1178
max_cols = get_option ("display.max_columns" )
1180
- df = DataFrame (tm . rands_array ( 25 , size = ( 10 , max_cols - 1 )) )
1179
+ df = DataFrame ([[ "a" * 25 ] * ( max_cols - 1 )] * 10 )
1181
1180
with option_context ("display.expand_frame_repr" , False ):
1182
1181
rep_str = repr (df )
1183
1182
@@ -1203,7 +1202,7 @@ def test_wide_repr_wide_columns(self):
1203
1202
def test_wide_repr_named (self ):
1204
1203
with option_context ("mode.sim_interactive" , True , "display.max_columns" , 20 ):
1205
1204
max_cols = get_option ("display.max_columns" )
1206
- df = DataFrame (tm . rands_array ( 25 , size = ( 10 , max_cols - 1 )) )
1205
+ df = DataFrame ([[ "a" * 25 ] * ( max_cols - 1 )] * 10 )
1207
1206
df .index .name = "DataFrame Index"
1208
1207
with option_context ("display.expand_frame_repr" , False ):
1209
1208
rep_str = repr (df )
@@ -1220,9 +1219,9 @@ def test_wide_repr_named(self):
1220
1219
1221
1220
def test_wide_repr_multiindex (self ):
1222
1221
with option_context ("mode.sim_interactive" , True , "display.max_columns" , 20 ):
1223
- midx = MultiIndex .from_arrays (tm . rands_array ( 5 , size = ( 2 , 10 )) )
1222
+ midx = MultiIndex .from_arrays ([[ "a" * 5 ] * 10 ] * 2 )
1224
1223
max_cols = get_option ("display.max_columns" )
1225
- df = DataFrame (tm . rands_array ( 25 , size = ( 10 , max_cols - 1 )) , index = midx )
1224
+ df = DataFrame ([[ "a" * 25 ] * ( max_cols - 1 )] * 10 , index = midx )
1226
1225
df .index .names = ["Level 0" , "Level 1" ]
1227
1226
with option_context ("display.expand_frame_repr" , False ):
1228
1227
rep_str = repr (df )
@@ -1240,10 +1239,10 @@ def test_wide_repr_multiindex(self):
1240
1239
def test_wide_repr_multiindex_cols (self ):
1241
1240
with option_context ("mode.sim_interactive" , True , "display.max_columns" , 20 ):
1242
1241
max_cols = get_option ("display.max_columns" )
1243
- midx = MultiIndex .from_arrays (tm . rands_array ( 5 , size = ( 2 , 10 )) )
1244
- mcols = MultiIndex .from_arrays (tm . rands_array ( 3 , size = ( 2 , max_cols - 1 )) )
1242
+ midx = MultiIndex .from_arrays ([[ "a" * 5 ] * 10 ] * 2 )
1243
+ mcols = MultiIndex .from_arrays ([[ "b" * 3 ] * ( max_cols - 1 )] * 2 )
1245
1244
df = DataFrame (
1246
- tm . rands_array ( 25 , ( 10 , max_cols - 1 )) , index = midx , columns = mcols
1245
+ [[ "c" * 25 ] * ( max_cols - 1 )] * 10 , index = midx , columns = mcols
1247
1246
)
1248
1247
df .index .names = ["Level 0" , "Level 1" ]
1249
1248
with option_context ("display.expand_frame_repr" , False ):
@@ -1259,7 +1258,7 @@ def test_wide_repr_multiindex_cols(self):
1259
1258
def test_wide_repr_unicode (self ):
1260
1259
with option_context ("mode.sim_interactive" , True , "display.max_columns" , 20 ):
1261
1260
max_cols = 20
1262
- df = DataFrame (tm . rands_array ( 25 , size = ( 10 , max_cols - 1 ) ))
1261
+ df = DataFrame ([[ "a" * 25 ] * 10 ] * ( max_cols - 1 ))
1263
1262
with option_context ("display.expand_frame_repr" , False ):
1264
1263
rep_str = repr (df )
1265
1264
with option_context ("display.expand_frame_repr" , True ):
@@ -1897,11 +1896,11 @@ def test_repr_html_mathjax(self):
1897
1896
1898
1897
def test_repr_html_wide (self ):
1899
1898
max_cols = 20
1900
- df = DataFrame (tm . rands_array ( 25 , size = ( 10 , max_cols - 1 )) )
1899
+ df = DataFrame ([[ "a" * 25 ] * ( max_cols - 1 )] * 10 )
1901
1900
with option_context ("display.max_rows" , 60 , "display.max_columns" , 20 ):
1902
1901
assert "..." not in df ._repr_html_ ()
1903
1902
1904
- wide_df = DataFrame (tm . rands_array ( 25 , size = ( 10 , max_cols + 1 )) )
1903
+ wide_df = DataFrame ([[ "a" * 25 ] * ( max_cols + 1 )] * 10 )
1905
1904
with option_context ("display.max_rows" , 60 , "display.max_columns" , 20 ):
1906
1905
assert "..." in wide_df ._repr_html_ ()
1907
1906
@@ -1911,14 +1910,14 @@ def test_repr_html_wide_multiindex_cols(self):
1911
1910
mcols = MultiIndex .from_product (
1912
1911
[np .arange (max_cols // 2 ), ["foo" , "bar" ]], names = ["first" , "second" ]
1913
1912
)
1914
- df = DataFrame (tm . rands_array ( 25 , size = ( 10 , len (mcols ))) , columns = mcols )
1913
+ df = DataFrame ([[ "a" * 25 ] * len (mcols )] * 10 , columns = mcols )
1915
1914
reg_repr = df ._repr_html_ ()
1916
1915
assert "..." not in reg_repr
1917
1916
1918
1917
mcols = MultiIndex .from_product (
1919
1918
(np .arange (1 + (max_cols // 2 )), ["foo" , "bar" ]), names = ["first" , "second" ]
1920
1919
)
1921
- df = DataFrame (tm . rands_array ( 25 , size = ( 10 , len (mcols ))) , columns = mcols )
1920
+ df = DataFrame ([[ "a" * 25 ] * len (mcols )] * 10 , columns = mcols )
1922
1921
with option_context ("display.max_rows" , 60 , "display.max_columns" , 20 ):
1923
1922
assert "..." in df ._repr_html_ ()
1924
1923
0 commit comments