PyPi provides the comath
module, which adds additional math functionality to Python.
The module can be installed using or downloading and installing the wheel package or .tar.gz
file from https://pypi.python.org/pypi/comath/0.0.3:
pip install comath
Note that not all functions in comath
are displayed here, as some require additional packages such as NumPy, which are beyond the scope of this book, or are modified versions of existing math
functions:
array.percentile(sorted_list, percent [, key=lambda x: x])
function returns the desired percentile (as defined bypercent
) from a sorted list of numbers:
- For the list of numbers, line 4 returns the 10th percentile.
- The line 5 returns the 30th percentile.
- The line 6 returns the 50th percentile.
- The line 7 returns the 75th percentile.
- The line 8 returns the 99th percentile.
func.get_smooth_step_function(min_val, max_val, switch_point, smooth_factor)
function returns a function that moves smoothly...