Skip to content

Commit 35a4301

Browse files
author
MomIsBestFriend
committed
Less than 7 digits
1 parent eddfb8f commit 35a4301

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

pandas/core/computation/align.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def _align_core(terms):
100100
reindexer_size = len(reindexer)
101101

102102
ordm = np.log10(max(1, abs(reindexer_size - term_axis_size)))
103-
if ordm >= 1 and reindexer_size >= 10_000:
103+
if ordm >= 1 and reindexer_size >= 10000:
104104
w = (
105105
f"Alignment difference on axis {axis} is larger "
106106
f"than an order of magnitude on term {repr(terms[i].name)}, "

pandas/tests/io/formats/test_format.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def test_repr_truncation(self):
233233
else:
234234
assert "..." not in line
235235

236-
with option_context("display.max_colwidth", 999_999):
236+
with option_context("display.max_colwidth", 999999):
237237
assert "..." not in repr(df)
238238

239239
with option_context("display.max_colwidth", max_len + 2):
@@ -408,10 +408,10 @@ def test_repr_truncation_column_size(self):
408408
# determine size of truncation (...) column
409409
df = pd.DataFrame(
410410
{
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],
415415
"e": ["a" * 50] * 2,
416416
}
417417
)
@@ -719,7 +719,7 @@ def test_east_asian_unicode_false(self):
719719

720720
# mid col
721721
df = DataFrame(
722-
{"a": ["あ", "いいい", "う", "ええええええ"], "b": [1, 222, 33_333, 4]},
722+
{"a": ["あ", "いいい", "う", "ええええええ"], "b": [1, 222, 33333, 4]},
723723
index=["a", "bb", "c", "ddd"],
724724
)
725725
expected = (
@@ -755,7 +755,7 @@ def test_east_asian_unicode_false(self):
755755

756756
# column name
757757
df = DataFrame(
758-
{"b": ["あ", "いいい", "う", "ええええええ"], "あああああ": [1, 222, 33_333, 4]},
758+
{"b": ["あ", "いいい", "う", "ええええええ"], "あああああ": [1, 222, 33333, 4]},
759759
index=["a", "bb", "c", "ddd"],
760760
)
761761
expected = (
@@ -857,7 +857,7 @@ def test_east_asian_unicode_true(self):
857857

858858
# mid col
859859
df = DataFrame(
860-
{"a": ["あ", "いいい", "う", "ええええええ"], "b": [1, 222, 33_333, 4]},
860+
{"a": ["あ", "いいい", "う", "ええええええ"], "b": [1, 222, 33333, 4]},
861861
index=["a", "bb", "c", "ddd"],
862862
)
863863
expected = (
@@ -869,7 +869,7 @@ def test_east_asian_unicode_true(self):
869869

870870
# last col
871871
df = DataFrame(
872-
{"a": [1, 222, 33_333, 4], "b": ["あ", "いいい", "う", "ええええええ"]},
872+
{"a": [1, 222, 33333, 4], "b": ["あ", "いいい", "う", "ええええええ"]},
873873
index=["a", "bb", "c", "ddd"],
874874
)
875875
expected = (
@@ -895,7 +895,7 @@ def test_east_asian_unicode_true(self):
895895

896896
# column name
897897
df = DataFrame(
898-
{"b": ["あ", "いいい", "う", "ええええええ"], "あああああ": [1, 222, 33_333, 4]},
898+
{"b": ["あ", "いいい", "う", "ええええええ"], "あああああ": [1, 222, 33333, 4]},
899899
index=["a", "bb", "c", "ddd"],
900900
)
901901
expected = (
@@ -1002,7 +1002,7 @@ def test_east_asian_unicode_true(self):
10021002

10031003
# ambiguous unicode
10041004
df = DataFrame(
1005-
{"b": ["あ", "いいい", "¡¡", "ええええええ"], "あああああ": [1, 222, 33_333, 4]},
1005+
{"b": ["あ", "いいい", "¡¡", "ええええええ"], "あああああ": [1, 222, 33333, 4]},
10061006
index=["a", "bb", "c", "¡¡¡"],
10071007
)
10081008
expected = (
@@ -1545,7 +1545,7 @@ def test_to_string_float_formatting(self):
15451545
)
15461546

15471547
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]}
15491549
)
15501550

15511551
df_s = df.to_string()
@@ -1587,7 +1587,7 @@ def test_to_string_float_formatting(self):
15871587
def test_to_string_float_format_no_fixed_width(self):
15881588

15891589
# GH 21625
1590-
df = DataFrame({"x": [0.19_999]})
1590+
df = DataFrame({"x": [0.19999]})
15911591
expected = " x\n0 0.200"
15921592
assert df.to_string(float_format="%.3f") == expected
15931593

@@ -2261,7 +2261,7 @@ def test_east_asian_unicode_series(self):
22612261
idx = pd.MultiIndex.from_tuples(
22622262
[("あ", "いい"), ("う", "え"), ("おおお", "かかかか"), ("き", "くく")]
22632263
)
2264-
s = Series([1, 22, 3333, 44_444], index=idx)
2264+
s = Series([1, 22, 3333, 44444], 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, 3333, 44_444], index=[1, "AB", np.nan, "あああ"])
2274+
s = Series([1, 22, 3333, 44444], index=[1, "AB", np.nan, "あああ"])
22752275
expected = (
22762276
"1 1\nAB 22\nNaN 3333\nあああ 44444\ndtype: int64"
22772277
)
22782278
assert repr(s) == expected
22792279

22802280
# object dtype, longer than unicode repr
22812281
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"), "あああ"]
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, 3333, 44_444], index=idx)
2359+
s = Series([1, 22, 3333, 44444], 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, 3333, 44_444], index=[1, "AB", np.nan, "あああ"])
2370+
s = Series([1, 22, 3333, 44444], index=[1, "AB", np.nan, "あああ"])
23712371
expected = (
23722372
"1 1\nAB 22\nNaN 3333\n"
23732373
"あああ 44444\ndtype: 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, 3333, 44_444],
2379+
[1, 22, 3333, 44444],
23802380
index=[1, "AB", pd.Timestamp("2011-01-01"), "あああ"],
23812381
)
23822382
expected = (
@@ -2479,7 +2479,7 @@ def test_timedelta64(self):
24792479

24802480
from datetime import datetime, timedelta
24812481

2482-
Series(np.array([11_00, 20], dtype="timedelta64[ns]")).to_string()
2482+
Series(np.array([1100, 20], dtype="timedelta64[ns]")).to_string()
24832483

24842484
s = Series(date_range("2012-1-1", periods=3, freq="D"))
24852485

@@ -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.6789]))
2894+
df = pd.DataFrame(dict(x=[12345.6789]))
28952895
assert str(df) == " x\n0 12345.6789"
28962896
df = pd.DataFrame(dict(x=[2e6]))
28972897
assert str(df) == " x\n0 2000000.0"

pandas/tests/io/parser/test_usecols.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def test_usecols_with_unicode_strings(all_parsers):
349349
parser = all_parsers
350350

351351
exp_data = {
352-
"AAA": {0: 0.056674972999999997, 1: 2.6132309819999997, 2: 3.5689350380000002,},
352+
"AAA": {0: 0.056674972999999997, 1: 2.6132309819999997, 2: 3.5689350380000002},
353353
"BBB": {0: 8, 1: 2, 2: 7},
354354
}
355355
expected = DataFrame(exp_data)
@@ -367,7 +367,7 @@ def test_usecols_with_single_byte_unicode_strings(all_parsers):
367367
parser = all_parsers
368368

369369
exp_data = {
370-
"A": {0: 0.056674972999999997, 1: 2.6132309819999997, 2: 3.5689350380000002,},
370+
"A": {0: 0.056674972999999997, 1: 2.6132309819999997, 2: 3.5689350380000002},
371371
"B": {0: 8, 1: 2, 2: 7},
372372
}
373373
expected = DataFrame(exp_data)
@@ -397,7 +397,7 @@ def test_usecols_with_multi_byte_characters(all_parsers, usecols):
397397
parser = all_parsers
398398

399399
exp_data = {
400-
"あああ": {0: 0.056674972999999997, 1: 2.6132309819999997, 2: 3.5689350380000002,},
400+
"あああ": {0: 0.056674972999999997, 1: 2.6132309819999997, 2: 3.5689350380000002},
401401
"いい": {0: 8, 1: 2, 2: 7},
402402
}
403403
expected = DataFrame(exp_data)

0 commit comments

Comments
 (0)