Skip to content
Related Articles

Related Articles

numpy.dtype.base() function – Python
  • Last Updated : 11 Jun, 2020

numpy.dtype.base() function returns dtype for the base element of the subarrays, regardless of their dimension or shape.

Syntax : numpy.dtype.base()

Return : Returns data type of the base element.

Code #1 :




# Python program explaining
# numpy.dtype.base() function
         
# importing numpy as geek 
import numpy as geek 
     
x = geek.dtype('i2')
   
gfg = x.base
   
print (gfg)

Output :



int16

 
Code #2 :




# Python program explaining
# numpy.dtype.base() function
         
# importing numpy as geek 
import numpy as geek 
     
x = geek.dtype('8f')
   
gfg = x.base
   
print (gfg)

Output :

float32

 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

My Personal Notes arrow_drop_up
Recommended Articles
Page :