Skip to content

Commit 2d8d6ac

Browse files
committed
[26660] moved format percentiles with integer indexes test to separate method
1 parent f97bf76 commit 2d8d6ac

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pandas/tests/io/formats/test_format.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2729,11 +2729,6 @@ def test_format_percentiles():
27292729
expected = ['0%', '50%', '2.0%', '50%', '66.67%', '99.99%']
27302730
assert result == expected
27312731

2732-
result = fmt.format_percentiles(np.linspace(0, 1, 10 + 1))
2733-
expected = ['0%', '10%', '20%', '30%', '40%', '50%',
2734-
'60%', '70%', '80%', '90%', '100%']
2735-
assert result == expected
2736-
27372732
msg = r"percentiles should all be in the interval \[0,1\]"
27382733
with pytest.raises(ValueError, match=msg):
27392734
fmt.format_percentiles([0.1, np.nan, 0.5])
@@ -2745,6 +2740,13 @@ def test_format_percentiles():
27452740
fmt.format_percentiles([0.1, 0.5, 'a'])
27462741

27472742

2743+
def test_format_percentiles_integer_idx():
2744+
result = fmt.format_percentiles(np.linspace(0, 1, 10 + 1))
2745+
expected = ['0%', '10%', '20%', '30%', '40%', '50%',
2746+
'60%', '70%', '80%', '90%', '100%']
2747+
assert result == expected
2748+
2749+
27482750
def test_repr_html_ipython_config(ip):
27492751
code = textwrap.dedent("""\
27502752
import pandas as pd

0 commit comments

Comments
 (0)