@@ -1874,7 +1874,7 @@ def __iter__(self):
1874
1874
"""
1875
1875
return iter (self ._internal_get_values ().tolist ())
1876
1876
1877
- def __contains__ (self , key ):
1877
+ def __contains__ (self , key ) -> bool :
1878
1878
"""
1879
1879
Returns True if `key` is in this Categorical.
1880
1880
"""
@@ -1884,7 +1884,7 @@ def __contains__(self, key):
1884
1884
1885
1885
return contains (self , key , container = self ._codes )
1886
1886
1887
- def _tidy_repr (self , max_vals = 10 , footer = True ):
1887
+ def _tidy_repr (self , max_vals = 10 , footer = True ) -> str :
1888
1888
""" a short repr displaying only max_vals and an optional (but default
1889
1889
footer)
1890
1890
"""
@@ -1921,7 +1921,7 @@ def _repr_categories(self):
1921
1921
category_strs = [x .strip () for x in category_strs ]
1922
1922
return category_strs
1923
1923
1924
- def _repr_categories_info (self ):
1924
+ def _repr_categories_info (self ) -> str :
1925
1925
"""
1926
1926
Returns a string representation of the footer.
1927
1927
"""
@@ -1951,11 +1951,11 @@ def _repr_categories_info(self):
1951
1951
# replace to simple save space by
1952
1952
return levheader + "[" + levstring .replace (" < ... < " , " ... " ) + "]"
1953
1953
1954
- def _repr_footer (self ):
1954
+ def _repr_footer (self ) -> str :
1955
1955
info = self ._repr_categories_info ()
1956
1956
return f"Length: { len (self )} \n { info } "
1957
1957
1958
- def _get_repr (self , length = True , na_rep = "NaN" , footer = True ):
1958
+ def _get_repr (self , length = True , na_rep = "NaN" , footer = True ) -> str :
1959
1959
from pandas .io .formats import format as fmt
1960
1960
1961
1961
formatter = fmt .CategoricalFormatter (
0 commit comments