@@ -1336,71 +1336,6 @@ def is_bool_dtype(arr_or_dtype) -> bool:
13361336 return issubclass (dtype .type , np .bool_ )
13371337
13381338
1339- def is_extension_type (arr ) -> bool :
1340- """
1341- Check whether an array-like is of a pandas extension class instance.
1342-
1343- .. deprecated:: 1.0.0
1344- Use ``is_extension_array_dtype`` instead.
1345-
1346- Extension classes include categoricals, pandas sparse objects (i.e.
1347- classes represented within the pandas library and not ones external
1348- to it like scipy sparse matrices), and datetime-like arrays.
1349-
1350- Parameters
1351- ----------
1352- arr : array-like, scalar
1353- The array-like to check.
1354-
1355- Returns
1356- -------
1357- boolean
1358- Whether or not the array-like is of a pandas extension class instance.
1359-
1360- Examples
1361- --------
1362- >>> is_extension_type([1, 2, 3])
1363- False
1364- >>> is_extension_type(np.array([1, 2, 3]))
1365- False
1366- >>>
1367- >>> cat = pd.Categorical([1, 2, 3])
1368- >>>
1369- >>> is_extension_type(cat)
1370- True
1371- >>> is_extension_type(pd.Series(cat))
1372- True
1373- >>> is_extension_type(pd.arrays.SparseArray([1, 2, 3]))
1374- True
1375- >>> from scipy.sparse import bsr_matrix
1376- >>> is_extension_type(bsr_matrix([1, 2, 3]))
1377- False
1378- >>> is_extension_type(pd.DatetimeIndex([1, 2, 3]))
1379- False
1380- >>> is_extension_type(pd.DatetimeIndex([1, 2, 3], tz="US/Eastern"))
1381- True
1382- >>>
1383- >>> dtype = DatetimeTZDtype("ns", tz="US/Eastern")
1384- >>> s = pd.Series([], dtype=dtype)
1385- >>> is_extension_type(s)
1386- True
1387- """
1388- warnings .warn (
1389- "'is_extension_type' is deprecated and will be removed in a future "
1390- "version. Use 'is_extension_array_dtype' instead." ,
1391- FutureWarning ,
1392- stacklevel = find_stack_level (),
1393- )
1394-
1395- if is_categorical_dtype (arr ):
1396- return True
1397- elif is_sparse (arr ):
1398- return True
1399- elif is_datetime64tz_dtype (arr ):
1400- return True
1401- return False
1402-
1403-
14041339def is_1d_only_ea_obj (obj : Any ) -> bool :
14051340 """
14061341 ExtensionArray that does not support 2D, or more specifically that does
@@ -1853,7 +1788,6 @@ def is_all_strings(value: ArrayLike) -> bool:
18531788 "is_dtype_equal" ,
18541789 "is_ea_or_datetimelike_dtype" ,
18551790 "is_extension_array_dtype" ,
1856- "is_extension_type" ,
18571791 "is_file_like" ,
18581792 "is_float_dtype" ,
18591793 "is_int64_dtype" ,
0 commit comments