MCPcopy
hub / github.com/glamp/bashplotlib / drange

Function drange

bashplotlib/utils/helpers.py:49–66  ·  view source on GitHub ↗

Generate between 2 numbers w/ optional step, optionally include upper bound

(start, stop, step=1.0, include_stop=False)

Source from the content-addressed store, hash-verified

47
48
49def drange(start, stop, step=1.0, include_stop=False):
50 """
51 Generate between 2 numbers w/ optional step, optionally include upper bound
52 """
53 if step == 0:
54 step = 0.01
55 r = start
56
57 if include_stop:
58 while r <= stop:
59 yield r
60 r += step
61 r = round(r, 10)
62 else:
63 while r < stop:
64 yield r
65 r += step
66 r = round(r, 10)
67
68
69def abbreviate(labels, rfill=' '):

Callers 3

get_scaleFunction · 0.85
calc_binsFunction · 0.85
plot_histFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected