diff --git a/cf_pandas/accessor.py b/cf_pandas/accessor.py index 9c18a4e..7386ff1 100644 --- a/cf_pandas/accessor.py +++ b/cf_pandas/accessor.py @@ -107,7 +107,11 @@ def __getitem__(self, key: str) -> Union[pd.Series, pd.DataFrame]: # if key is a coordinate or axes, use a different method to match valid_keys = _COORD_NAMES + _AXIS_NAMES - if key in valid_keys: + # return the key if it is already a name in the object and doesn't need to be interpreted + if key in self._obj.keys(): + col_names = [key] + + elif key in valid_keys: col_names = _get_axis_coord(self._obj, key) else: