Python | Numpy ndarray.real()
With the help of
Numpy ndarray.real() method, we can find the real values in an imaginary expressions by just using
ndarray.real() method. Remember resulting data type for the real value is ‘float64’.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Return : Array of Real values having dtype ‘float64’
Example #1 :
In this example we can see that we get the array of real values using
ndarray.real() method and we are also trying to print the dtype of those real values.
[ 1. 2.] 'float64'
Example #2 :
[ 1.27201965 1.67414923] float64