@@ -233,7 +233,7 @@ def test_repr_truncation(self):
233
233
else :
234
234
assert "..." not in line
235
235
236
- with option_context ("display.max_colwidth" , 999_999 ):
236
+ with option_context ("display.max_colwidth" , 999999 ):
237
237
assert "..." not in repr (df )
238
238
239
239
with option_context ("display.max_colwidth" , max_len + 2 ):
@@ -408,10 +408,10 @@ def test_repr_truncation_column_size(self):
408
408
# determine size of truncation (...) column
409
409
df = pd .DataFrame (
410
410
{
411
- "a" : [108_480 , 30_830 ],
412
- "b" : [12_345 , 12_345 ],
413
- "c" : [12_345 , 12_345 ],
414
- "d" : [12_345 , 12_345 ],
411
+ "a" : [108480 , 30830 ],
412
+ "b" : [12345 , 12345 ],
413
+ "c" : [12345 , 12345 ],
414
+ "d" : [12345 , 12345 ],
415
415
"e" : ["a" * 50 ] * 2 ,
416
416
}
417
417
)
@@ -719,7 +719,7 @@ def test_east_asian_unicode_false(self):
719
719
720
720
# mid col
721
721
df = DataFrame (
722
- {"a" : ["あ" , "いいい" , "う" , "ええええええ" ], "b" : [1 , 222 , 33_333 , 4 ]},
722
+ {"a" : ["あ" , "いいい" , "う" , "ええええええ" ], "b" : [1 , 222 , 33333 , 4 ]},
723
723
index = ["a" , "bb" , "c" , "ddd" ],
724
724
)
725
725
expected = (
@@ -755,7 +755,7 @@ def test_east_asian_unicode_false(self):
755
755
756
756
# column name
757
757
df = DataFrame (
758
- {"b" : ["あ" , "いいい" , "う" , "ええええええ" ], "あああああ" : [1 , 222 , 33_333 , 4 ]},
758
+ {"b" : ["あ" , "いいい" , "う" , "ええええええ" ], "あああああ" : [1 , 222 , 33333 , 4 ]},
759
759
index = ["a" , "bb" , "c" , "ddd" ],
760
760
)
761
761
expected = (
@@ -857,7 +857,7 @@ def test_east_asian_unicode_true(self):
857
857
858
858
# mid col
859
859
df = DataFrame (
860
- {"a" : ["あ" , "いいい" , "う" , "ええええええ" ], "b" : [1 , 222 , 33_333 , 4 ]},
860
+ {"a" : ["あ" , "いいい" , "う" , "ええええええ" ], "b" : [1 , 222 , 33333 , 4 ]},
861
861
index = ["a" , "bb" , "c" , "ddd" ],
862
862
)
863
863
expected = (
@@ -869,7 +869,7 @@ def test_east_asian_unicode_true(self):
869
869
870
870
# last col
871
871
df = DataFrame (
872
- {"a" : [1 , 222 , 33_333 , 4 ], "b" : ["あ" , "いいい" , "う" , "ええええええ" ]},
872
+ {"a" : [1 , 222 , 33333 , 4 ], "b" : ["あ" , "いいい" , "う" , "ええええええ" ]},
873
873
index = ["a" , "bb" , "c" , "ddd" ],
874
874
)
875
875
expected = (
@@ -895,7 +895,7 @@ def test_east_asian_unicode_true(self):
895
895
896
896
# column name
897
897
df = DataFrame (
898
- {"b" : ["あ" , "いいい" , "う" , "ええええええ" ], "あああああ" : [1 , 222 , 33_333 , 4 ]},
898
+ {"b" : ["あ" , "いいい" , "う" , "ええええええ" ], "あああああ" : [1 , 222 , 33333 , 4 ]},
899
899
index = ["a" , "bb" , "c" , "ddd" ],
900
900
)
901
901
expected = (
@@ -1002,7 +1002,7 @@ def test_east_asian_unicode_true(self):
1002
1002
1003
1003
# ambiguous unicode
1004
1004
df = DataFrame (
1005
- {"b" : ["あ" , "いいい" , "¡¡" , "ええええええ" ], "あああああ" : [1 , 222 , 33_333 , 4 ]},
1005
+ {"b" : ["あ" , "いいい" , "¡¡" , "ええええええ" ], "あああああ" : [1 , 222 , 33333 , 4 ]},
1006
1006
index = ["a" , "bb" , "c" , "¡¡¡" ],
1007
1007
)
1008
1008
expected = (
@@ -1545,7 +1545,7 @@ def test_to_string_float_formatting(self):
1545
1545
)
1546
1546
1547
1547
df = DataFrame (
1548
- {"x" : [0 , 0.25 , 3456.000 , 12e45 , 1.64e6 , 1.7e8 , 1.253_456 , np .pi , - 1e6 ]}
1548
+ {"x" : [0 , 0.25 , 3456.000 , 12e45 , 1.64e6 , 1.7e8 , 1.253456 , np .pi , - 1e6 ]}
1549
1549
)
1550
1550
1551
1551
df_s = df .to_string ()
@@ -1587,7 +1587,7 @@ def test_to_string_float_formatting(self):
1587
1587
def test_to_string_float_format_no_fixed_width (self ):
1588
1588
1589
1589
# GH 21625
1590
- df = DataFrame ({"x" : [0.19_999 ]})
1590
+ df = DataFrame ({"x" : [0.19999 ]})
1591
1591
expected = " x\n 0 0.200"
1592
1592
assert df .to_string (float_format = "%.3f" ) == expected
1593
1593
@@ -2261,7 +2261,7 @@ def test_east_asian_unicode_series(self):
2261
2261
idx = pd .MultiIndex .from_tuples (
2262
2262
[("あ" , "いい" ), ("う" , "え" ), ("おおお" , "かかかか" ), ("き" , "くく" )]
2263
2263
)
2264
- s = Series ([1 , 22 , 3333 , 44_444 ], index = idx )
2264
+ s = Series ([1 , 22 , 3333 , 44444 ], index = idx )
2265
2265
expected = (
2266
2266
"あ いい 1\n "
2267
2267
"う え 22\n "
@@ -2271,15 +2271,15 @@ def test_east_asian_unicode_series(self):
2271
2271
assert repr (s ) == expected
2272
2272
2273
2273
# object dtype, shorter than unicode repr
2274
- s = Series ([1 , 22 , 3333 , 44_444 ], index = [1 , "AB" , np .nan , "あああ" ])
2274
+ s = Series ([1 , 22 , 3333 , 44444 ], index = [1 , "AB" , np .nan , "あああ" ])
2275
2275
expected = (
2276
2276
"1 1\n AB 22\n NaN 3333\n あああ 44444\n dtype: int64"
2277
2277
)
2278
2278
assert repr (s ) == expected
2279
2279
2280
2280
# object dtype, longer than unicode repr
2281
2281
s = Series (
2282
- [1 , 22 , 3333 , 44_444 ], index = [1 , "AB" , pd .Timestamp ("2011-01-01" ), "あああ" ]
2282
+ [1 , 22 , 3333 , 44444 ], index = [1 , "AB" , pd .Timestamp ("2011-01-01" ), "あああ" ]
2283
2283
)
2284
2284
expected = (
2285
2285
"1 1\n "
@@ -2356,7 +2356,7 @@ def test_east_asian_unicode_series(self):
2356
2356
idx = pd .MultiIndex .from_tuples (
2357
2357
[("あ" , "いい" ), ("う" , "え" ), ("おおお" , "かかかか" ), ("き" , "くく" )]
2358
2358
)
2359
- s = Series ([1 , 22 , 3333 , 44_444 ], index = idx )
2359
+ s = Series ([1 , 22 , 3333 , 44444 ], index = idx )
2360
2360
expected = (
2361
2361
"あ いい 1\n "
2362
2362
"う え 22\n "
@@ -2367,7 +2367,7 @@ def test_east_asian_unicode_series(self):
2367
2367
assert repr (s ) == expected
2368
2368
2369
2369
# object dtype, shorter than unicode repr
2370
- s = Series ([1 , 22 , 3333 , 44_444 ], index = [1 , "AB" , np .nan , "あああ" ])
2370
+ s = Series ([1 , 22 , 3333 , 44444 ], index = [1 , "AB" , np .nan , "あああ" ])
2371
2371
expected = (
2372
2372
"1 1\n AB 22\n NaN 3333\n "
2373
2373
"あああ 44444\n dtype: int64"
@@ -2376,7 +2376,7 @@ def test_east_asian_unicode_series(self):
2376
2376
2377
2377
# object dtype, longer than unicode repr
2378
2378
s = Series (
2379
- [1 , 22 , 3333 , 44_444 ],
2379
+ [1 , 22 , 3333 , 44444 ],
2380
2380
index = [1 , "AB" , pd .Timestamp ("2011-01-01" ), "あああ" ],
2381
2381
)
2382
2382
expected = (
@@ -2479,7 +2479,7 @@ def test_timedelta64(self):
2479
2479
2480
2480
from datetime import datetime , timedelta
2481
2481
2482
- Series (np .array ([11_00 , 20 ], dtype = "timedelta64[ns]" )).to_string ()
2482
+ Series (np .array ([1100 , 20 ], dtype = "timedelta64[ns]" )).to_string ()
2483
2483
2484
2484
s = Series (date_range ("2012-1-1" , periods = 3 , freq = "D" ))
2485
2485
@@ -2891,7 +2891,7 @@ def test_too_long(self):
2891
2891
with pd .option_context ("display.precision" , 4 ):
2892
2892
# need both a number > 1e6 and something that normally formats to
2893
2893
# having length > display.precision + 6
2894
- df = pd .DataFrame (dict (x = [12_345 .6789 ]))
2894
+ df = pd .DataFrame (dict (x = [12345 .6789 ]))
2895
2895
assert str (df ) == " x\n 0 12345.6789"
2896
2896
df = pd .DataFrame (dict (x = [2e6 ]))
2897
2897
assert str (df ) == " x\n 0 2000000.0"
0 commit comments