numpy.mintypecode(typechars, typeset='GDFgdf', default='d')
[source]
Return the character for the minimum-size type to which given types can be safely cast.
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 typechars
(or if typechars
is an array, then its dtype.char).
Parameters: |
|
---|---|
Returns: |
|
See also
>>> np.mintypecode(['d', 'f', 'S']) 'd' >>> x = np.array([1.1, 2-3.j]) >>> np.mintypecode(x) 'D'
>>> np.mintypecode('abceh', default='G') 'G'
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.mintypecode.html