py4design.utility module¶
-
py4design.utility.
frange
(start, end=None, inc=None)¶ A range function, that does accept float increments.
Parameters: start : float
The starting number of the sequence.
end : float, optional
Generate numbers up to, but not including this number, Default = None. When None, end == start and start = 0.0.
inc : float, optional
The difference between each number in the sequence, Default = None. When None, inc = 1.0.
Returns: sequence of floats : list of floats
A list of float.
-
py4design.utility.
findmedian
(lst)¶ This function finds the median.
Parameters: lst : list of ints/floats
The list to be analysed.
Returns: median : int/float
The median of the list.
-
py4design.utility.
round2nearest_base
(x, base=5)¶ This function rounds the int/float to the nearest base.
Parameters: x : int/float
The number to be rounded.
base : int, optional
The base to round x to, if 5 will round to the nearest multiple of 5, if 10 will round to the nearest 10.
Returns: rounded number : int/float
The rounded number.