Wednesday, October 8, 2025
HomeLanguagesnumpy.sctype2char() function – Python

numpy.sctype2char() function – Python

numpy.sctype2char() function return the string representation of a scalar dtype.

Syntax : numpy.sctype2char(sctype)

Parameters :
sctype : [scalar dtype or object] If a sctype is a scalar dtype, the corresponding string character is returned. If an object, sctype2char tries to infer its scalar type and then return the corresponding string character.
Return : [str] The string character corresponding to the scalar type.

Code #1 :




# Python program explaining
# numpy.sctype2char() function
            
# importing numpy as geek 
import numpy as geek 
  
x = geek.array([1., 2-1.j])
  
gfg = geek.sctype2char(x)
  
print (gfg)


Output :

D

 
Code #2 :




# Python program explaining
# numpy.sctype2char() function
            
# importing numpy as geek 
import numpy as geek 
  
gfg = geek.sctype2char(list)
  
print (gfg)


Output :

0
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
6712 POSTS0 COMMENTS
Nicole Veronica
11875 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