Thursday, October 9, 2025
HomeLanguagesnumpy.typename() function – Python

numpy.typename() function – Python

numpy.typename() function return a description for the given data type code.

Syntax : numpy.typename(char)

Parameters :
char : [str] Data type code.
Return : [str] Description of the input data type code.

Code #1 :




# Python program explaining
# numpy.typename() function
            
# importing numpy as geek 
import numpy as geek 
  
typechars = ['?', 'O', 'b', 'd', 'g', 'f', 'i', 'h', 'l', 'q'
  
for typechar in typechars:
    print(typechar, ' : ', geek.typename(typechar))


Output :

?  :  bool
O  :  object
b  :  signed char
d  :  double precision
g  :  long precision
f  :  single precision
i  :  integer
h  :  short
l  :  long integer
q  :  long long integer

 
Code #2 :




# Python program explaining
# numpy.typename() function
            
# importing numpy as geek 
import numpy as geek 
  
typechars = ['S1', 'B', 'D', 'G', 'F', 'I', 'H', 'L', 'Q', 'S', 'U', 'V'
  
for typechar in typechars:
    print(typechar, ' : ', geek.typename(typechar))


Output :

S1  :  character
B  :  unsigned char
D  :  complex double precision
G  :  complex long double precision
F  :  complex single precision
I  :  unsigned integer
H  :  unsigned short
L  :  unsigned long integer
Q  :  unsigned long long integer
S  :  string
U  :  unicode
V  :  void
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32342 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6713 POSTS0 COMMENTS
Nicole Veronica
11876 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11937 POSTS0 COMMENTS
Shaida Kate Naidoo
6833 POSTS0 COMMENTS
Ted Musemwa
7092 POSTS0 COMMENTS
Thapelo Manthata
6786 POSTS0 COMMENTS
Umr Jansen
6789 POSTS0 COMMENTS