inclusiverange#
- inclusiverange(*args, **kwargs)[source]#
Like
numpy.arange()
/numpy.linspace, but includes the start and stop points. Accepts 0-3 args, or the kwargs start, stop, step.In most cases, equivalent to
np.linspace(start, stop, int((stop-start)/step)+1)
.- Parameters:
start (float) – value to start at
stop (float) – value to stop at
step (float) – step size
kwargs (dict) – passed to
numpy.linspace()
Examples:
x = sc.inclusiverange(10) # Like np.arange(11) x = sc.inclusiverange(3,5,0.2) # Like np.linspace(3, 5, int((5-3)/0.2+1)) x = sc.inclusiverange(stop=5) # Like np.arange(6) x = sc.inclusiverange(6, step=2) # Like np.arange(0, 7, 2)