Skip to content

Commit 84df4c6

Browse files
authored
more doctests for make_cut_points (#888)
1 parent b6f0d5a commit 84df4c6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

dp_wizard/utils/shared/bins.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ def make_cut_points(
2121
2222
>>> make_cut_points(0, 10, 2)
2323
[0.0, 5.0, 10.0]
24+
>>> make_cut_points(-1, 1, 4)
25+
[-1.0, -0.5, 0.0, 0.5, 1.0]
26+
27+
Will return fewer points than requested if cut points
28+
only differ in later decimal places.
29+
30+
>>> make_cut_points(1, 1.01, 4)
31+
[1.0]
2432
"""
2533
bin_width = (upper_bound - lower_bound) / bin_count
2634
# Duplicate values would cause an error in Polars.

0 commit comments

Comments
 (0)