Numpy nth root: How to
To find the n
th root of number or array x
in numpy use:
np.power(x, (1/n))
n
can be a natural number like 4
but it can also be a floating point number like 3.26
.
Example: Compute the 78th root of 1.234
>>> import numpy as np
>>> np.power(1.234, (1/78))
1.0026992894299456
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow