diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index ce87c0a8b0c5a..30949ca6d1d6b 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -195,13 +195,13 @@ def __setitem__(self, key, value): ) def __len__(self): + # type: () -> int """Length of this array Returns ------- length : int """ - # type: () -> int raise AbstractMethodError(self) def __iter__(self): diff --git a/pandas/core/base.py b/pandas/core/base.py index c331ead8d2fef..6625a3bbe97d7 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -788,6 +788,7 @@ def base(self): @property def _ndarray_values(self): + # type: () -> np.ndarray """The data as an ndarray, possibly losing information. The expectation is that this is cheap to compute, and is primarily @@ -795,7 +796,6 @@ def _ndarray_values(self): - categorical -> codes """ - # type: () -> np.ndarray if is_extension_array_dtype(self): return self.values._ndarray_values return self.values diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index c45838e6040a9..05f82c67ddb8b 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -5,17 +5,19 @@ PY3, PY36) from pandas._libs import algos, lib from pandas._libs.tslibs import conversion -from .dtypes import (CategoricalDtype, CategoricalDtypeType, - DatetimeTZDtype, DatetimeTZDtypeType, - PeriodDtype, PeriodDtypeType, - IntervalDtype, IntervalDtypeType, - ExtensionDtype, PandasExtensionDtype) -from .generic import (ABCCategorical, ABCPeriodIndex, - ABCDatetimeIndex, ABCSeries, - ABCSparseArray, ABCSparseSeries, ABCCategoricalIndex, - ABCIndexClass, ABCDateOffset) -from .inference import is_string_like, is_list_like -from .inference import * # noqa +from pandas.core.dtypes.dtypes import ( + CategoricalDtype, CategoricalDtypeType, DatetimeTZDtype, + DatetimeTZDtypeType, PeriodDtype, PeriodDtypeType, IntervalDtype, + IntervalDtypeType, ExtensionDtype, PandasExtensionDtype) +from pandas.core.dtypes.generic import ( + ABCCategorical, ABCPeriodIndex, ABCDatetimeIndex, ABCSeries, + ABCSparseArray, ABCSparseSeries, ABCCategoricalIndex, ABCIndexClass, + ABCDateOffset) +from pandas.core.dtypes.inference import ( # noqa:F401 + is_bool, is_integer, is_hashable, is_iterator, is_float, + is_dict_like, is_scalar, is_string_like, is_list_like, is_number, + is_file_like, is_re, is_re_compilable, is_sequence, is_nested_list_like, + is_named_tuple, is_array_like, is_decimal, is_complex, is_interval) _POSSIBLY_CAST_DTYPES = set([np.dtype(t).name