This mathematical function helps user to calculate cube root of x for all x being the array elements.
Syntax:
numpy.cbrt(arr, out = None, ufunc ‘cbrt’) :
Parameters :
arr : [array_like] Input array or object
whose elements, we need to square.
Return :
An array with cube root of x for all x i.e. array elements
Code #1 : Working
Output :
cbrt Value of arr1 :
[ 1. 30. 4. -10.]
cbrt Value of arr2 : [ 10.0793684 -5.0396842]
Code #2 : Working with complex numbers
Output :
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