numpy.cbrt(arr, out = None, ufunc ‘cbrt’) : This mathematical function helps user to calculate cube root of x for all x being the array elements.
arr : [array_like] Input array or object whose elements, we need to square.
An array with cube root of x for all x i.e. array elements
Code #1 : Working
cbrt Value of arr1 : [ 1. 30. 4. -10.] cbrt Value of arr2 : [ 10.0793684 -5.0396842]
Code #2 : Working with complex numbers
TypeError: ufunc 'cbrt' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Code #3 : Graphical representation
Graphical Representation : [-1.70997595 2.30347441 3.08793243 3.60027433 3.99768384 4.3287262 4.61565763 4.87076238 5.10162421 5.31329285]
- Reading Python File-Like Objects from C | Python
- Important differences between Python 2.x and Python 3.x with examples
- Python | Add Logging to a Python Script
- Python | Add Logging to Python Libraries
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Sort Python Dictionaries by Key or Value
- bin() in Python
- Any & All in Python
- Python Set | pop()
- chr() in Python
- Use of min() and max() in Python
- SHA in Python
- gcd() in Python
- pow() in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.