Skip to content

Commit 998f917

Browse files
committed
added tests for format_percentiles function
1 parent 132ecfc commit 998f917

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/tests/io/formats/test_format.py

+5
Original file line numberDiff line numberDiff line change
@@ -3262,6 +3262,11 @@ def test_format_percentiles():
32623262
expected = ["0%", "50%", "2.0%", "50%", "66.67%", "99.99%"]
32633263
assert result == expected
32643264

3265+
# Issue #46362
3266+
result = fmt.format_percentiles([0.281,0.57,0.58,0.29])
3267+
expected = ['28.1%', '57%', '58%', '29%']
3268+
assert result == expected
3269+
32653270
msg = r"percentiles should all be in the interval \[0,1\]"
32663271
with pytest.raises(ValueError, match=msg):
32673272
fmt.format_percentiles([0.1, np.nan, 0.5])

0 commit comments

Comments
 (0)