Skip to content

Commit bf704ac

Browse files
authored
Update format.py
1 parent ee5ff56 commit bf704ac

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/io/formats/format.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1576,11 +1576,12 @@ def format_percentiles(
15761576
):
15771577
raise ValueError("percentiles should all be in the interval [0,1]")
15781578

1579-
# Fix for issue #60550
15801579
if len(percentiles) > 0 :
1580+
15811581
percentiles = 100 * percentiles
15821582

15831583
else :
1584+
15841585
percentiles = np.array([])
15851586

15861587
prec = get_precision(percentiles)
@@ -1602,8 +1603,9 @@ def format_percentiles(
16021603

16031604

16041605
def get_precision(array: np.ndarray | Sequence[float]) -> int:
1605-
# Fix for issue #60550
1606-
if array.size == 0:
1606+
1607+
if len(array) == 0:
1608+
16071609
return 0
16081610

16091611
to_begin = array[0] if array[0] > 0 else None

0 commit comments

Comments
 (0)