pandas 1.4.2

NotesParametersReturnsBackRef
format_percentiles(percentiles: 'np.ndarray | list[int | float] | list[float] | list[str | float]') -> 'list[str]'

Notes

Rounding precision is chosen so that: (1) if any two elements of percentiles differ, they remain different after rounding (2) no entry is rounded to 0% or 100%. Any non-integer is always rounded to at least 1 decimal place.

Parameters

percentiles : list-like, containing floats from interval [0,1]

Returns

formatted : list of strings

Outputs rounded and formatted percentiles.

Examples

Keeps all entries different after rounding:

This example is valid syntax, but we were not able to check execution
>>> format_percentiles([0.01999, 0.02001, 0.5, 0.666666, 0.9999])
['1.999%', '2.001%', '50%', '66.667%', '99.99%']

No element is rounded to 0% or 100% (unless already equal to it). Duplicates are allowed:

This example is valid syntax, but we were not able to check execution
>>> format_percentiles([0, 0.5, 0.02001, 0.5, 0.666666, 0.9999])
['0%', '50%', '2.0%', '50%', '66.67%', '99.99%']
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.io.formats.format.format_percentiles

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/io/formats/format.py#1667
type: <class 'function'>
Commit: