parameters: (self, other: Categorical)
return_statement: return self._from_backing_data(codes)
docstring: Re-encode another categorical using this Categorical's categories.
  
          Notes
          -----
          This assumes we have already checked
          self._categories_match_up_to_permutation(other).
docstring_summary: Re-encode another categorical using this Categorical's categories.
docstring_tokens: Re - encode another categorical using this Categorical s categories .
function: def _encode_with_my_categories(self, other: Categorical) -> Categorical:
          """
          Re-encode another categorical using this Categorical's categories.
  
          Notes
          -----
          This assumes we have already checked
          self._categories_match_up_to_permutation(other).
          """
          # Indexing on codes is more efficient if categories are the same,
          #  so we can apply some optimizations based on the degree of
          #  dtype-matching.
          codes = recode_for_categories(
              other.codes, other.categories, self.categories, copy=False
          )
          return self._from_backing_data(codes)
function_tokens: def _encode_with_my_categories ( self , other : Categorical ) -> Categorical : # Indexing on codes is more efficient if categories are the same, #  so we can apply some optimizations based on the degree of #  dtype-matching. codes = recode_for_categories ( other . codes , other . categories , self . categories , copy = False ) return self . _from_backing_data ( codes )