Python | Numpy np.min_scalar_type() method
With the help of np.min_scalar_type()
method, we can get the minimum scalar type of a value that is passed as a parameter in np.min_scalar_type()
method.
Syntax : np.min_scalar_type(value)
Return : Return the minimum scalar type of a value.
Example #1 :
In this example we can see that by using np.min_scalar_type()
method, we are able to get the minimum scalar type of a value by using this method.
import numpy as np
gfg = np.min_scalar_type( - 50 )
print (gfg)
|
Output :
int8
Example #2 :
import numpy as np
gfg = np.min_scalar_type( 55.56 )
print (gfg)
|
Output :
float16
Last Updated :
03 Nov, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...