pandas 1.4.2

ParametersReturnsBackRef
is_extension_type(arr) -> 'bool'
deprecated

Use is_extension_array_dtype instead.

Extension classes include categoricals, pandas sparse objects (i.e. classes represented within the pandas library and not ones external to it like scipy sparse matrices), and datetime-like arrays.

Parameters

arr : array-like, scalar

The array-like to check.

Returns

boolean

Whether or not the array-like is of a pandas extension class instance.

Check whether an array-like is of a pandas extension class instance.

Examples

This example is valid syntax, but we were not able to check execution
>>> is_extension_type([1, 2, 3])
False
This example is valid syntax, but we were not able to check execution
>>> is_extension_type(np.array([1, 2, 3]))
False
>>>
This example is valid syntax, but we were not able to check execution
>>> cat = pd.Categorical([1, 2, 3])
>>>
This example is valid syntax, but we were not able to check execution
>>> is_extension_type(cat)
True
This example is valid syntax, but we were not able to check execution
>>> is_extension_type(pd.Series(cat))
True
This example is valid syntax, but we were not able to check execution
>>> is_extension_type(pd.arrays.SparseArray([1, 2, 3]))
True
This example is valid syntax, but we were not able to check execution
>>> from scipy.sparse import bsr_matrix
... is_extension_type(bsr_matrix([1, 2, 3])) False
This example is valid syntax, but we were not able to check execution
>>> is_extension_type(pd.DatetimeIndex([1, 2, 3]))
False
This example is valid syntax, but we were not able to check execution
>>> is_extension_type(pd.DatetimeIndex([1, 2, 3], tz="US/Eastern"))
True
>>>
This example is valid syntax, but we were not able to check execution
>>> dtype = DatetimeTZDtype("ns", tz="US/Eastern")
... s = pd.Series([], dtype=dtype)
... is_extension_type(s) True
See :

Back References

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

pandas.core.dtypes.common.is_extension_type

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


File: /pandas/core/dtypes/common.py#1334
type: <class 'function'>
Commit: