numpy.mintypecode(typechars,typeset='GDFgdf',default='d')[source]¶Return the character for the minimum-size type to which given types canbe safely cast.
The returned type character must represent the smallest size dtype suchthat an array of the returned type can handle the data from an array ofall types intypechars (or iftypechars is an array, then itsdtype.char).
| Parameters: |
|
|---|---|
| Returns: |
|
See also
dtype,sctype2char,maximum_sctype
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'