You are viewing an older version (2.4.3).Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / typename

function

numpy:typename

source: /numpy/lib/_type_check_impl.py:585

Signature

def typename(char)

Summary

Return a description for the given data type code.

Parameters

char : str

Data type code.

Returns

out : str

Description of the input data type code.

Examples

import numpy as np
typechars = ['S1', '?', 'B', 'D', 'G', 'F', 'I', 'H', 'L', 'O', 'Q',
             'S', 'U', 'V', 'b', 'd', 'g', 'f', 'i', 'h', 'l', 'q']
for typechar in typechars:
    print(typechar, ' : ', np.typename(typechar))
✓
S1  :  character
?  :  bool
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
O  :  object
Q  :  unsigned long long integer
S  :  string
U  :  unicode
V  :  void
b  :  signed char
d  :  double precision
g  :  long precision
f  :  single precision
i  :  integer
h  :  short
l  :  long integer
q  :  long long integer

See also

dtype

Aliases

  • numpy.typename