numpy.sctype2char()函數返回標量dtype的字符串表示形式。
用法: numpy.sctype2char(sctype)
參數:
sctype:[標量dtype或對象]如果sctype是標量dtype,則返回相應的字符串字符。如果是對象,則sctype2char嘗試推斷其標量類型,然後返回相應的字符串字符。
返回:[str]與標量類型相對應的字符串字符。
代碼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)
輸出:
D
代碼2:
# Python program explaining
# numpy.sctype2char() function
# importing numpy as geek
import numpy as geek
gfg = geek.sctype2char(list)
print (gfg)
輸出:
0
相關用法
- Python Wand function()用法及代碼示例
- Python now()用法及代碼示例
- Python id()用法及代碼示例
- Python tell()用法及代碼示例
- Python sum()用法及代碼示例
- Python str()用法及代碼示例
- Python cmp()用法及代碼示例
- Python ord()用法及代碼示例
- Python dir()用法及代碼示例
- Python hex()用法及代碼示例
- Python int()用法及代碼示例
- Python map()用法及代碼示例
- Python oct()用法及代碼示例
- Python math.sin()用法及代碼示例
- Python bytearray()用法及代碼示例
- Python math.tan()用法及代碼示例
注:本文由純淨天空篩選整理自sanjoy_62大神的英文原創作品 numpy.sctype2char() function – Python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。