
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How can SciPy be used to calculate the cube root of values and exponential values in Python?
When it is required to find the cube root of values, a function present in SciPy library can be used.
Syntax of ‘cbrt’ function
scipy.special.cbrt(x)
The ‘x’ is the parameter that is passed to the function ‘cbrt’ that is present in ‘special’ class of ‘SciPy’ library. Here’s an example −
Example
from scipy.special import cbrt my_cb = cbrt([27, 89]) print("The cube roots are :") print(my_cb)
Output
The cube roots are : [3. 4.4647451]
Explanation
- The required packages are imported.
- The ‘cbrt’ function is called on the list of values whose cube root needs to be computed.
- The output is displayed on the console.
When it is required to find the 10**x of an element or a list of elements, a function named ‘exp10’ present in SciPy library can be used.
Syntax of ‘exp10’ function
scipy.special.exp10(x)
The ‘x’ is the parameter that is passed to the function ‘exp10’ that is present in ‘special’ class of ‘SciPy’ library.
Example
from scipy.special import exp10 my_exp = exp10([12,17]) print("The exponential function has been called") print(my_exp)
Output
The exponential function has been called [1.e+12 1.e+17]
Explanation
- The required packages are imported.
- The ‘exp10’ function is called on the list of values whose exponential values needs to be computed.
- The output is displayed on the console.
- Related Articles
- How can SciPy be used to calculate the permutations and combination values in Python?
- How can SciPy be used to calculate the eigen values and eigen vectors of a matrix in Python?
- How can SciPy be used to calculate the inverse of a matrix in Python?
- How can SciPy be used to calculate the determinant value of a matrix in Python?
- How to find the cube root of negative values in R?
- Python Program to calculate the cube root of the given number
- How can discrete Fourier transform be performed in SciPy Python?
- How can ‘implot’ function be used to fit values to data if one of the variables is a discrete value in Python?
- How can Tensorflow be used with pre-trained model to rescale pixel values?
- Haskell Program to calculate the cube root of the given number
- C++ Program to calculate the cube root of the given number
- How can Tensorflow be used to predict values on the new data for the augmented data?
- How BEFORE INSERT triggers can be used to emulate CHECK CONSTRAINT for inserting values in the table?
- How BEFORE UPDATE triggers can be used to emulate CHECK CONSTRAINT\nfor updating values in the table?
- What is SciPy in Python? Explain how it can be installed, and its applications?

Advertisements