class_docstr: Parameters
  ----------
  data : mapping
      Mapping of keys to column values.
  multiindex : bool, optional
      Whether tuple keys represent a hierarchical
      index with multiple "levels" (default=False).
  level_names : tuple, optional
      Tuple containing names for each of the levels.
      For a non-hierarchical index, a tuple of size 1
      may be passe.
  rangeindex : bool, optional
      Whether the keys should be returned as a RangeIndex
      in `to_pandas_index` (default=False).
  label_dtype : Dtype, optional
      What dtype should be returned in `to_pandas_index`
      (default=None).
class_docstr_tok: ["Parameters","--","--","--","--","--","data",":","mapping","Mapping","of","keys","to","column","values",".","multiindex",":","bool",",","optional","Whether","tuple","keys","represent","a","hierarchical","index","with","multiple","``","levels","''","(","default=False",")",".","level_names",":","tuple",",","optional","Tuple","containing","names","for","each","of","the","levels",".","For","a","non-hierarchical","index",",","a","tuple","of","size","1","may","be","passe",".","rangeindex",":","bool",",","optional","Whether","the","keys","should","be","returned","as","a","RangeIndex","in","`","to_pandas_index","`","(","default=False",")",".","label_dtype",":","Dtype",",","optional","What","dtype","should","be","returned","in","`","to_pandas_index","`","(","default=None",")","."]
docstr: Swap level i with level j.
  Calling this method does not change the ordering of the values.
  
  Parameters
  ----------
  i : int or str, default -2
      First level of index to be swapped.
  j : int or str, default -1
      Second level of index to be swapped.
  
  Returns
  -------
  ColumnAccessor
docstr_tok: ["Swap","level","i","with","level","j",".","Calling","this","method","does","not","change","the","ordering","of","the","values",".","Parameters","--","--","--","--","--","i",":","int","or","str",",","default","-2","First","level","of","index","to","be","swapped",".","j",":","int","or","str",",","default","-1","Second","level","of","index","to","be","swapped",".","Returns","--","--","--","-","ColumnAccessor"]
code: def swaplevel(self, i=-2, j=-1):
      """
      Swap level i with level j.
      Calling this method does not change the ordering of the values.
  
      Parameters
      ----------
      i : int or str, default -2
          First level of index to be swapped.
      j : int or str, default -1
          Second level of index to be swapped.
  
      Returns
      -------
      ColumnAccessor
      """
  
      i = _get_level(i, self.nlevels, self.level_names)
      j = _get_level(j, self.nlevels, self.level_names)
  
      new_keys = [list(row) for row in self]
      new_dict = {}
  
      # swap old keys for i and j
      for n, row in enumerate(self.names):
          new_keys[n][i], new_keys[n][j] = row[j], row[i]
          new_dict.update({row: tuple(new_keys[n])})
  
      new_data = {
          new_dict[k]: v.copy(deep=True) for k, v in self.items()
      }
  
      # swap level_names for i and j
      new_names = list(self.level_names)
      new_names[i], new_names[j] = new_names[j], new_names[i]
  
      return self.__class__(
          new_data,
          multiindex=True,
          level_names=new_names,
      )
  
imports: from __future__ import annotations
  import itertools
  import warnings
  from collections import abc
  from functools import cached_property, reduce
  from typing import TYPE_CHECKING, Any, Callable, Dict, Mapping, Optional, Tuple, Union
  import numpy
  import pandas
  from packaging.version import Version
  from pandas.api.types import is_bool
  from typing_extensions import Self
  import cudf
  from cudf.core import column
label_desc: Use image node_id 24 for calling the ColumnAccessor obj's underlying member method code with example usage: obj.swaplevel(i, j) and returns: self