pandas.Index.inferred_type#

Index.inferred_type[source]#

Return a string of the type inferred from the values.

This inspects the actual values in the Index to determine their type, which may differ from the stored dtype. For example, an object-dtype Index containing only integers returns 'integer'.

See also

Index.dtype

Return the dtype object of the underlying data.

Examples

>>> idx = pd.Index([1, 2, 3])
>>> idx
Index([1, 2, 3], dtype='int64')
>>> idx.inferred_type
'integer'