Skip to content

Commit f97bf76

Browse files
committed
[26660] absolute value of percentiles diff (int and float) when determining if indexes are integers
1 parent 1064c12 commit f97bf76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/io/formats/format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ def format_percentiles(percentiles):
12461246
raise ValueError("percentiles should all be in the interval [0,1]")
12471247

12481248
percentiles = 100 * percentiles
1249-
int_idx = ((percentiles.astype(int) - percentiles) < 1e-4)
1249+
int_idx = (abs(percentiles.astype(int) - percentiles) < 1e-4)
12501250

12511251
if np.all(int_idx):
12521252
out = percentiles.astype(int).astype(str)

0 commit comments

Comments
 (0)