numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
mintypecode(typechars, typeset='GDFgdf', default='d')

The returned type character must represent the smallest size dtype such that an array of the returned type can handle the data from an array of all types in :None:None:`typechars` (or if :None:None:`typechars` is an array, then its dtype.char).

Parameters

typechars : list of str or array_like

If a list of strings, each string should represent a dtype. If array_like, the character representation of the array dtype is used.

typeset : str or list of str, optional

The set of characters that the returned character is chosen from. The default set is 'GDFgdf'.

default : str, optional

The default character, this is returned if none of the characters in :None:None:`typechars` matches a character in :None:None:`typeset`.

Returns

typechar : str

The character representing the minimum-size type that was found.

Return the character for the minimum-size type to which given types can be safely cast.

See Also

dtype
maximum_sctype
sctype2char

Examples

>>> np.mintypecode(['d', 'f', 'S'])
'd'
>>> x = np.array([1.1, 2-3.j])
... np.mintypecode(x) 'D'
>>> np.mintypecode('abceh', default='G')
'G'
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.find_common_type numpy.common_type numpy.maximum_sctype numpy.sctype2char

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/lib/type_check.py#26
type: <class 'function'>
Commit: