diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index 5b51bc9debb33..a6a5f142faf1c 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -62,8 +62,6 @@ is_list_like, ) -from pandas.util import capitalize_first_letter - if not pa_version_under10p1: import pyarrow as pa @@ -1087,7 +1085,7 @@ def na_value(self) -> NaTType: def __eq__(self, other: object) -> bool: if isinstance(other, str): - return other in [self.name, capitalize_first_letter(self.name)] + return other[:1].lower() + other[1:] == self.name return super().__eq__(other) diff --git a/pandas/util/__init__.py b/pandas/util/__init__.py index 59ab324ba38ca..da109a514433f 100644 --- a/pandas/util/__init__.py +++ b/pandas/util/__init__.py @@ -27,7 +27,3 @@ def __getattr__(key: str): def __dir__(): return list(globals().keys()) + ["hash_array", "hash_pandas_object"] - - -def capitalize_first_letter(s: str) -> str: - return s[:1].upper() + s[1:]