def endswith(self, pat: str | bytes | Any) -> T_DataArray:
        """
        Test if the end of each string in the array matches a pattern.

        The pattern `pat` can either be a ``str`` or array-like of ``str``.
        If array-like, it will be broadcast and applied elementwise.

        Parameters
        ----------
        pat : str
            Character sequence. Regular expressions are not accepted.
            If array-like, it is broadcast.

        Returns
        -------
        endswith : array of bool
            A Series of booleans indicating whether the given pattern matches
            the end of each string element.

        Examples
        --------
        >>> da = xr.DataArray(["10C", "10c", "100F"], dims="x")
        >>> da
        <xarray.DataArray (x: 3)> Size: 48B
        array(['10C', '10c', '100F'], dtype='<U4')
        Dimensions without coordinates: x
        >>> endswith = da.str.endswith("C")
        >>> endswith
        <xarray.DataArray (x: 3)> Size: 3B
        array([ True, False, False])
        Dimensions without coordinates: x
        """
        pat = self._stringify(pat)
        func = lambda x, y: x.endswith(y)
        return self._apply(func=func, func_args=(pat,), dtype=bool)

        Test if the end of each string in the array matches a pattern.

        The pattern `pat` can either be a ``str`` or array-like of ``str``.
        If array-like, it will be broadcast and applied elementwise.

        Parameters
        ----------
        pat : str
            Character sequence. Regular expressions are not accepted.
            If array-like, it is broadcast.

        Returns
        -------
        endswith : array of bool
            A Series of booleans indicating whether the given pattern matches
            the end of each string element.

        Examples
        --------
        >>> da = xr.DataArray(["10C", "10c", "100F"], dims="x")
        >>> da
        <xarray.DataArray (x: 3)> Size: 48B
        array(['10C', '10c', '100F'], dtype='<U4')
        Dimensions without coordinates: x
        >>> endswith = da.str.endswith("C")
        >>> endswith
        <xarray.DataArray (x: 3)> Size: 3B
        array([ True, False, False])
        Dimensions without coordinates: x
        
xarray/core/accessor_str.py