@@ -286,11 +286,11 @@ def test_repr_chop_threshold_column_below(self):
286286 )
287287
288288 def test_repr_obeys_max_seq_limit (self ):
289- with option_context ("display.max_seq_items" , 2_000 ):
290- assert len (printing .pprint_thing (list (range (1_000 )))) > 1_000
289+ with option_context ("display.max_seq_items" , 2000 ):
290+ assert len (printing .pprint_thing (list (range (1000 )))) > 1000
291291
292292 with option_context ("display.max_seq_items" , 5 ):
293- assert len (printing .pprint_thing (list (range (1_000 )))) < 100
293+ assert len (printing .pprint_thing (list (range (1000 )))) < 100
294294
295295 def test_repr_set (self ):
296296 assert printing .pprint_thing ({1 }) == "{1}"
@@ -354,10 +354,10 @@ def test_expand_frame_repr(self):
354354 def test_repr_non_interactive (self ):
355355 # in non interactive mode, there can be no dependency on the
356356 # result of terminal auto size detection
357- df = DataFrame ("hello" , index = range (1_000 ), columns = range (5 ))
357+ df = DataFrame ("hello" , index = range (1000 ), columns = range (5 ))
358358
359359 with option_context (
360- "mode.sim_interactive" , False , "display.width" , 0 , "display.max_rows" , 5_000
360+ "mode.sim_interactive" , False , "display.width" , 0 , "display.max_rows" , 5000
361361 ):
362362 assert not has_truncated_repr (df )
363363 assert not has_expanded_repr (df )
@@ -1339,7 +1339,7 @@ def test_wide_repr_wide_long_columns(self):
13391339 assert "ddddd" in result
13401340
13411341 def test_long_series (self ):
1342- n = 1_000
1342+ n = 1000
13431343 s = Series (
13441344 np .random .randint (- 50 , 50 , n ),
13451345 index = ["s{x:04d}" .format (x = x ) for x in range (n )],
@@ -1545,7 +1545,7 @@ def test_to_string_float_formatting(self):
15451545 )
15461546
15471547 df = DataFrame (
1548- {"x" : [0 , 0.25 , 3_456 .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.253_456 , np .pi , - 1e6 ]}
15491549 )
15501550
15511551 df_s = df .to_string ()
@@ -1566,7 +1566,7 @@ def test_to_string_float_formatting(self):
15661566 )
15671567 assert df_s == expected
15681568
1569- df = DataFrame ({"x" : [3_234 , 0.253 ]})
1569+ df = DataFrame ({"x" : [3234 , 0.253 ]})
15701570 df_s = df .to_string ()
15711571
15721572 expected = " x\n 0 3234.000\n 1 0.253"
@@ -1636,9 +1636,9 @@ def test_to_string_complex_float_formatting(self):
16361636 df = DataFrame (
16371637 {
16381638 "x" : [
1639- (0.4_467_846_931_321_966 + 0.0_715_185_102_060_818j ),
1640- (0.2_739_442_392_974_528 + 0.23_515_228_785_438_969j ),
1641- (0.26_974_928_742_135_185 + 0.3_250_604_054_898_979j ),
1639+ (0.4467846931321966 + 0.0715185102060818j ),
1640+ (0.2739442392974528 + 0.23515228785438969j ),
1641+ (0.26974928742135185 + 0.3250604054898979j ),
16421642 (- 1j ),
16431643 ]
16441644 }
@@ -1690,7 +1690,7 @@ def test_to_string_index_formatter(self):
16901690
16911691 def test_to_string_left_justify_cols (self ):
16921692 tm .reset_display_options ()
1693- df = DataFrame ({"x" : [3_234 , 0.253 ]})
1693+ df = DataFrame ({"x" : [3234 , 0.253 ]})
16941694 df_s = df .to_string (justify = "left" )
16951695 expected = " x \n 0 3234.000\n 1 0.253"
16961696 assert df_s == expected
@@ -1699,7 +1699,7 @@ def test_to_string_format_na(self):
16991699 tm .reset_display_options ()
17001700 df = DataFrame (
17011701 {
1702- "A" : [np .nan , - 1 , - 2.1_234 , 3 , 4 ],
1702+ "A" : [np .nan , - 1 , - 2.1234 , 3 , 4 ],
17031703 "B" : [np .nan , "foo" , "foooo" , "fooooo" , "bar" ],
17041704 }
17051705 )
@@ -1738,7 +1738,7 @@ def test_to_string_format_inf(self):
17381738 tm .reset_display_options ()
17391739 df = DataFrame (
17401740 {
1741- "A" : [- np .inf , np .inf , - 1 , - 2.1_234 , 3 , 4 ],
1741+ "A" : [- np .inf , np .inf , - 1 , - 2.1234 , 3 , 4 ],
17421742 "B" : [- np .inf , np .inf , "foo" , "foooo" , "fooooo" , "bar" ],
17431743 }
17441744 )
@@ -2076,11 +2076,11 @@ def __getitem__(self, key):
20762076
20772077 def test_float_trim_zeros (self ):
20782078 vals = [
2079- 2.08_430_917_305e10 ,
2080- 3.52_205_017_305e10 ,
2081- 2.30_674_817_305e10 ,
2082- 2.03_954_217_305e10 ,
2083- 5.59_897_817_305e10 ,
2079+ 2.08430917305e10 ,
2080+ 3.52205017305e10 ,
2081+ 2.30674817305e10 ,
2082+ 2.03954217305e10 ,
2083+ 5.59897817305e10 ,
20842084 ]
20852085 skip = True
20862086 for line in repr (DataFrame ({"A" : vals })).split ("\n " )[:- 2 ]:
@@ -2140,7 +2140,7 @@ def test_repr_unicode(self):
21402140 s = Series (["\u03c3 " ] * 10 )
21412141 repr (s )
21422142
2143- a = Series (["\u05d0 " ] * 1_000 )
2143+ a = Series (["\u05d0 " ] * 1000 )
21442144 a .name = "title1"
21452145 repr (a )
21462146
@@ -2202,7 +2202,7 @@ def test_to_string_mixed(self):
22022202 assert result == expected
22032203
22042204 def test_to_string_float_na_spacing (self ):
2205- s = Series ([0.0 , 1.5_678 , 2.0 , - 3.0 , 4.0 ])
2205+ s = Series ([0.0 , 1.5678 , 2.0 , - 3.0 , 4.0 ])
22062206 s [::2 ] = np .nan
22072207
22082208 result = s .to_string ()
@@ -2261,7 +2261,7 @@ def test_east_asian_unicode_series(self):
22612261 idx = pd .MultiIndex .from_tuples (
22622262 [("あ" , "いい" ), ("う" , "え" ), ("おおお" , "かかかか" ), ("き" , "くく" )]
22632263 )
2264- s = Series ([1 , 22 , 3_333 , 44_444 ], index = idx )
2264+ s = Series ([1 , 22 , 3333 , 44_444 ], index = idx )
22652265 expected = (
22662266 "あ いい 1\n "
22672267 "う え 22\n "
@@ -2271,15 +2271,15 @@ def test_east_asian_unicode_series(self):
22712271 assert repr (s ) == expected
22722272
22732273 # object dtype, shorter than unicode repr
2274- s = Series ([1 , 22 , 3_333 , 44_444 ], index = [1 , "AB" , np .nan , "あああ" ])
2274+ s = Series ([1 , 22 , 3333 , 44_444 ], index = [1 , "AB" , np .nan , "あああ" ])
22752275 expected = (
22762276 "1 1\n AB 22\n NaN 3333\n あああ 44444\n dtype: int64"
22772277 )
22782278 assert repr (s ) == expected
22792279
22802280 # object dtype, longer than unicode repr
22812281 s = Series (
2282- [1 , 22 , 3_333 , 44_444 ], index = [1 , "AB" , pd .Timestamp ("2011-01-01" ), "あああ" ]
2282+ [1 , 22 , 3333 , 44_444 ], index = [1 , "AB" , pd .Timestamp ("2011-01-01" ), "あああ" ]
22832283 )
22842284 expected = (
22852285 "1 1\n "
@@ -2356,7 +2356,7 @@ def test_east_asian_unicode_series(self):
23562356 idx = pd .MultiIndex .from_tuples (
23572357 [("あ" , "いい" ), ("う" , "え" ), ("おおお" , "かかかか" ), ("き" , "くく" )]
23582358 )
2359- s = Series ([1 , 22 , 3_333 , 44_444 ], index = idx )
2359+ s = Series ([1 , 22 , 3333 , 44_444 ], index = idx )
23602360 expected = (
23612361 "あ いい 1\n "
23622362 "う え 22\n "
@@ -2367,7 +2367,7 @@ def test_east_asian_unicode_series(self):
23672367 assert repr (s ) == expected
23682368
23692369 # object dtype, shorter than unicode repr
2370- s = Series ([1 , 22 , 3_333 , 44_444 ], index = [1 , "AB" , np .nan , "あああ" ])
2370+ s = Series ([1 , 22 , 3333 , 44_444 ], index = [1 , "AB" , np .nan , "あああ" ])
23712371 expected = (
23722372 "1 1\n AB 22\n NaN 3333\n "
23732373 "あああ 44444\n dtype: int64"
@@ -2376,7 +2376,7 @@ def test_east_asian_unicode_series(self):
23762376
23772377 # object dtype, longer than unicode repr
23782378 s = Series (
2379- [1 , 22 , 3_333 , 44_444 ],
2379+ [1 , 22 , 3333 , 44_444 ],
23802380 index = [1 , "AB" , pd .Timestamp ("2011-01-01" ), "あああ" ],
23812381 )
23822382 expected = (
@@ -2420,11 +2420,11 @@ def test_east_asian_unicode_series(self):
24202420
24212421 def test_float_trim_zeros (self ):
24222422 vals = [
2423- 2.08_430_917_305e10 ,
2424- 3.52_205_017_305e10 ,
2425- 2.30_674_817_305e10 ,
2426- 2.03_954_217_305e10 ,
2427- 5.59_897_817_305e10 ,
2423+ 2.08430917305e10 ,
2424+ 3.52205017305e10 ,
2425+ 2.30674817305e10 ,
2426+ 2.03954217305e10 ,
2427+ 5.59897817305e10 ,
24282428 ]
24292429 for line in repr (Series (vals )).split ("\n " ):
24302430 if line .startswith ("dtype:" ):
@@ -2624,7 +2624,7 @@ def test_max_multi_index_display(self):
26242624
26252625 # Make sure #8532 is fixed
26262626 def test_consistent_format (self ):
2627- s = pd .Series ([1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0.9_999 , 1 , 1 ] * 10 )
2627+ s = pd .Series ([1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 0.9999 , 1 , 1 ] * 10 )
26282628 with option_context ("display.max_rows" , 10 , "display.show_dimensions" , False ):
26292629 res = repr (s )
26302630 exp = (
@@ -2824,19 +2824,19 @@ def test_output_significant_digits(self):
28242824 "col1" : [
28252825 9.999e-8 ,
28262826 1e-7 ,
2827- 1.0_001e -7 ,
2827+ 1.0001e -7 ,
28282828 2e-7 ,
28292829 4.999e-7 ,
28302830 5e-7 ,
2831- 5.0_001e -7 ,
2831+ 5.0001e -7 ,
28322832 6e-7 ,
28332833 9.999e-7 ,
28342834 1e-6 ,
2835- 1.0_001e -6 ,
2835+ 1.0001e -6 ,
28362836 2e-6 ,
28372837 4.999e-6 ,
28382838 5e-6 ,
2839- 5.0_001e -6 ,
2839+ 5.0001e -6 ,
28402840 6e-6 ,
28412841 ]
28422842 }
@@ -2891,7 +2891,7 @@ def test_too_long(self):
28912891 with pd .option_context ("display.precision" , 4 ):
28922892 # need both a number > 1e6 and something that normally formats to
28932893 # having length > display.precision + 6
2894- df = pd .DataFrame (dict (x = [12_345.6_789 ]))
2894+ df = pd .DataFrame (dict (x = [12_345.6789 ]))
28952895 assert str (df ) == " x\n 0 12345.6789"
28962896 df = pd .DataFrame (dict (x = [2e6 ]))
28972897 assert str (df ) == " x\n 0 2000000.0"
0 commit comments