class_docstr: Index based on an underlying `Categorical`.
  
  CategoricalIndex can only take on a limited,
  and usually fixed, number of possible values (`categories`). Also,
  it might have an order, but numerical operations
  (additions, divisions, ...) are not possible.
  
  Parameters
  ----------
  data : array-like (1-dimensional)
      The values of the categorical. If `categories` are given, values not in
      `categories` will be replaced with NaN.
  categories : index-like, optional
      The categories for the categorical. Items need to be unique.
      If the categories are not given here (and also not in `dtype`), they
      will be inferred from the `data`.
  ordered : bool, optional
      Whether or not this categorical is treated as an ordered
      categorical. If not given here or in `dtype`, the resulting
      categorical will be unordered.
  dtype : CategoricalDtype or "category", optional
      If :class:`CategoricalDtype`, cannot be used together with
      `categories` or `ordered`.
  copy : bool, default False
      Make a copy of input ndarray.
  name : object, optional
      Name to be stored in the index.
  
  See Also
  --------
  Index : The base pandas-on-Spark Index type.
  
  Examples
  --------
  >>> ps.CategoricalIndex(["a", "b", "c", "a", "b", "c"])  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'],
                   categories=['a', 'b', 'c'], ordered=False, dtype='category')
  
  ``CategoricalIndex`` can also be instantiated from a ``Categorical``:
  
  >>> c = pd.Categorical(["a", "b", "c", "a", "b", "c"])
  >>> ps.CategoricalIndex(c)  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'],
                   categories=['a', 'b', 'c'], ordered=False, dtype='category')
  
  Ordered ``CategoricalIndex`` can have a min and max value.
  
  >>> ci = ps.CategoricalIndex(
  ...     ["a", "b", "c", "a", "b", "c"], ordered=True, categories=["c", "b", "a"]
  ... )
  >>> ci  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'],
                   categories=['c', 'b', 'a'], ordered=True, dtype='category')
  
  From a Series:
  
  >>> s = ps.Series(["a", "b", "c", "a", "b", "c"], index=[10, 20, 30, 40, 50, 60])
  >>> ps.CategoricalIndex(s)  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'],
                   categories=['a', 'b', 'c'], ordered=False, dtype='category')
  
  From an Index:
  
  >>> idx = ps.Index(["a", "b", "c", "a", "b", "c"])
  >>> ps.CategoricalIndex(idx)  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'],
                   categories=['a', 'b', 'c'], ordered=False, dtype='category')
class_docstr_tok: ["Index","based","on","an","underlying","`","Categorical","`",".","CategoricalIndex","can","only","take","on","a","limited",",","and","usually","fixed",",","number","of","possible","values","(","`","categories","`",")",".","Also",",","it","might","have","an","order",",","but","numerical","operations","(","additions",",","divisions",",","...",")","are","not","possible",".","Parameters","--","--","--","--","--","data",":","array-like","(","1-dimensional",")","The","values","of","the","categorical",".","If","`","categories","`","are","given",",","values","not","in","`","categories","`","will","be","replaced","with","NaN",".","categories",":","index-like",",","optional","The","categories","for","the","categorical",".","Items","need","to","be","unique",".","If","the","categories","are","not","given","here","(","and","also","not","in","`","dtype","`",")",",","they","will","be","inferred","from","the","`","data","`",".","ordered",":","bool",",","optional","Whether","or","not","this","categorical","is","treated","as","an","ordered","categorical",".","If","not","given","here","or","in","`","dtype","`",",","the","resulting","categorical","will","be","unordered",".","dtype",":","CategoricalDtype","or","``","category","''",",","optional","If",":","class",":","`","CategoricalDtype","`",",","can","not","be","used","together","with","`","categories","`","or","`","ordered","`",".","copy",":","bool",",","default","False","Make","a","copy","of","input","ndarray",".","name",":","object",",","optional","Name","to","be","stored","in","the","index",".","See","Also","--","--","--","--","Index",":","The","base","pandas-on-Spark","Index","type",".","Examples","--","--","--","--",">",">",">","ps.CategoricalIndex","(","[","``","a","''",",","``","b","''",",","``","c","''",",","``","a","''",",","``","b","''",",","``","c","''","]",")","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'",",","'","a","'",",","'","b","'",",","'","c","'","]",",","categories=","[","'","a","'",",","'","b","'",",","'","c","'","]",",","ordered=False",",","dtype='category","'",")","``","CategoricalIndex","``","can","also","be","instantiated","from","a","``","Categorical","``",":",">",">",">","c","=","pd.Categorical","(","[","``","a","''",",","``","b","''",",","``","c","''",",","``","a","''",",","``","b","''",",","``","c","''","]",")",">",">",">","ps.CategoricalIndex","(","c",")","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'",",","'","a","'",",","'","b","'",",","'","c","'","]",",","categories=","[","'","a","'",",","'","b","'",",","'","c","'","]",",","ordered=False",",","dtype='category","'",")","Ordered","``","CategoricalIndex","``","can","have","a","min","and","max","value",".",">",">",">","ci","=","ps.CategoricalIndex","(","...","[","``","a","''",",","``","b","''",",","``","c","''",",","``","a","''",",","``","b","''",",","``","c","''","]",",","ordered=True",",","categories=","[","``","c","''",",","``","b","''",",","``","a","''","]","...",")",">",">",">","ci","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'",",","'","a","'",",","'","b","'",",","'","c","'","]",",","categories=","[","'","c","'",",","'","b","'",",","'","a","'","]",",","ordered=True",",","dtype='category","'",")","From","a","Series",":",">",">",">","s","=","ps.Series","(","[","``","a","''",",","``","b","''",",","``","c","''",",","``","a","''",",","``","b","''",",","``","c","''","]",",","index=","[","10",",","20",",","30",",","40",",","50",",","60","]",")",">",">",">","ps.CategoricalIndex","(","s",")","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'",",","'","a","'",",","'","b","'",",","'","c","'","]",",","categories=","[","'","a","'",",","'","b","'",",","'","c","'","]",",","ordered=False",",","dtype='category","'",")","From","an","Index",":",">",">",">","idx","=","ps.Index","(","[","``","a","''",",","``","b","''",",","``","c","''",",","``","a","''",",","``","b","''",",","``","c","''","]",")",">",">",">","ps.CategoricalIndex","(","idx",")","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'",",","'","a","'",",","'","b","'",",","'","c","'","]",",","categories=","[","'","a","'",",","'","b","'",",","'","c","'","]",",","ordered=False",",","dtype='category","'",")"]
docstr: Map values using input correspondence (a dict, Series, or function).
  
  Maps the values (their categories, not the codes) of the index to new
  categories. If the mapping correspondence is one-to-one the result is a
  `CategoricalIndex` which has the same order property as the original,
  otherwise an `Index` is returned.
  
  If a `dict` or `Series` is used any unmapped category is mapped to missing values.
  Note that if this happens an `Index` will be returned.
  
  Parameters
  ----------
  mapper : function, dict, or Series
      Mapping correspondence.
  
  Returns
  -------
  CategoricalIndex or Index
      Mapped index.
  
  See Also
  --------
  Index.map : Apply a mapping correspondence on an `Index`.
  Series.map : Apply a mapping correspondence on a `Series`
  Series.apply : Apply more complex functions on a `Series`
  
  Examples
  --------
  >>> idx = ps.CategoricalIndex(['a', 'b', 'c'])
  >>> idx  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex(['a', 'b', 'c'],
                   categories=['a', 'b', 'c'], ordered=False, dtype='category')
  
  >>> idx.map(lambda x: x.upper())  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex(['A', 'B', 'C'],
                   categories=['A', 'B', 'C'], ordered=False, dtype='category')
  
  >>> pser = pd.Series([1, 2, 3], index=pd.CategoricalIndex(['a', 'b', 'c'], ordered=True))
  >>> idx.map(pser)  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex([1, 2, 3],
                   categories=[1, 2, 3], ordered=False, dtype='category')
  
  >>> idx.map({'a': 'first', 'b': 'second', 'c': 'third'})  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex(['first', 'second', 'third'],
                   categories=['first', 'second', 'third'], ordered=False, dtype='category')
  
  If the mapping is one-to-one the ordering of the categories is preserved:
  
  >>> idx = ps.CategoricalIndex(['a', 'b', 'c'], ordered=True)
  >>> idx  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex(['a', 'b', 'c'],
                   categories=['a', 'b', 'c'], ordered=True, dtype='category')
  
  >>> idx.map({'a': 3, 'b': 2, 'c': 1})  # doctest: +NORMALIZE_WHITESPACE
  CategoricalIndex([3, 2, 1],
                   categories=[3, 2, 1], ordered=True, dtype='category')
  
  If the mapping is not one-to-one an `Index` is returned:
  
  >>> idx.map({'a': 'first', 'b': 'second', 'c': 'first'})
  Index(['first', 'second', 'first'], dtype='object')
  
  If a `dict` is used, all unmapped categories are mapped to None and
  the result is an `Index`:
  
  >>> idx.map({'a': 'first', 'b': 'second'})
  Index(['first', 'second', None], dtype='object')
docstr_tok: ["Map","values","using","input","correspondence","(","a","dict",",","Series",",","or","function",")",".","Maps","the","values","(","their","categories",",","not","the","codes",")","of","the","index","to","new","categories",".","If","the","mapping","correspondence","is","one-to-one","the","result","is","a","`","CategoricalIndex","`","which","has","the","same","order","property","as","the","original",",","otherwise","an","`","Index","`","is","returned",".","If","a","`","dict","`","or","`","Series","`","is","used","any","unmapped","category","is","mapped","to","missing","values",".","Note","that","if","this","happens","an","`","Index","`","will","be","returned",".","Parameters","--","--","--","--","--","mapper",":","function",",","dict",",","or","Series","Mapping","correspondence",".","Returns","--","--","--","-","CategoricalIndex","or","Index","Mapped","index",".","See","Also","--","--","--","--","Index.map",":","Apply","a","mapping","correspondence","on","an","`","Index","`",".","Series.map",":","Apply","a","mapping","correspondence","on","a","`","Series","`","Series.apply",":","Apply","more","complex","functions","on","a","`","Series","`","Examples","--","--","--","--",">",">",">","idx","=","ps.CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'","]",")",">",">",">","idx","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'","]",",","categories=","[","'","a","'",",","'","b","'",",","'","c","'","]",",","ordered=False",",","dtype='category","'",")",">",">",">","idx.map","(","lambda","x",":","x.upper","(",")",")","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","'","A","'",",","'","B","'",",","'","C","'","]",",","categories=","[","'","A","'",",","'","B","'",",","'","C","'","]",",","ordered=False",",","dtype='category","'",")",">",">",">","pser","=","pd.Series","(","[","1",",","2",",","3","]",",","index=pd.CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'","]",",","ordered=True",")",")",">",">",">","idx.map","(","pser",")","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","1",",","2",",","3","]",",","categories=","[","1",",","2",",","3","]",",","ordered=False",",","dtype='category","'",")",">",">",">","idx.map","(","{","'","a","'",":","'first","'",",","'","b","'",":","'second","'",",","'","c","'",":","'third","'","}",")","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","'first","'",",","'second","'",",","'third","'","]",",","categories=","[","'first","'",",","'second","'",",","'third","'","]",",","ordered=False",",","dtype='category","'",")","If","the","mapping","is","one-to-one","the","ordering","of","the","categories","is","preserved",":",">",">",">","idx","=","ps.CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'","]",",","ordered=True",")",">",">",">","idx","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","'","a","'",",","'","b","'",",","'","c","'","]",",","categories=","[","'","a","'",",","'","b","'",",","'","c","'","]",",","ordered=True",",","dtype='category","'",")",">",">",">","idx.map","(","{","'","a","'",":","3",",","'","b","'",":","2",",","'","c","'",":","1","}",")","#","doctest",":","+NORMALIZE_WHITESPACE","CategoricalIndex","(","[","3",",","2",",","1","]",",","categories=","[","3",",","2",",","1","]",",","ordered=True",",","dtype='category","'",")","If","the","mapping","is","not","one-to-one","an","`","Index","`","is","returned",":",">",">",">","idx.map","(","{","'","a","'",":","'first","'",",","'","b","'",":","'second","'",",","'","c","'",":","'first","'","}",")","Index","(","[","'first","'",",","'second","'",",","'first","'","]",",","dtype='object","'",")","If","a","`","dict","`","is","used",",","all","unmapped","categories","are","mapped","to","None","and","the","result","is","an","`","Index","`",":",">",">",">","idx.map","(","{","'","a","'",":","'first","'",",","'","b","'",":","'second","'","}",")","Index","(","[","'first","'",",","'second","'",",","None","]",",","dtype='object","'",")"]
code: def map(  # type: ignore[override]
      self, mapper: Union[dict, Callable[[Any], Any], pd.Series]
  ) -> "Index":
      """
      Map values using input correspondence (a dict, Series, or function).
  
      Maps the values (their categories, not the codes) of the index to new
      categories. If the mapping correspondence is one-to-one the result is a
      `CategoricalIndex` which has the same order property as the original,
      otherwise an `Index` is returned.
  
      If a `dict` or `Series` is used any unmapped category is mapped to missing values.
      Note that if this happens an `Index` will be returned.
  
      Parameters
      ----------
      mapper : function, dict, or Series
          Mapping correspondence.
  
      Returns
      -------
      CategoricalIndex or Index
          Mapped index.
  
      See Also
      --------
      Index.map : Apply a mapping correspondence on an `Index`.
      Series.map : Apply a mapping correspondence on a `Series`
      Series.apply : Apply more complex functions on a `Series`
  
      Examples
      --------
      >>> idx = ps.CategoricalIndex(['a', 'b', 'c'])
      >>> idx  # doctest: +NORMALIZE_WHITESPACE
      CategoricalIndex(['a', 'b', 'c'],
                       categories=['a', 'b', 'c'], ordered=False, dtype='category')
  
      >>> idx.map(lambda x: x.upper())  # doctest: +NORMALIZE_WHITESPACE
      CategoricalIndex(['A', 'B', 'C'],
                       categories=['A', 'B', 'C'], ordered=False, dtype='category')
  
      >>> pser = pd.Series([1, 2, 3], index=pd.CategoricalIndex(['a', 'b', 'c'], ordered=True))
      >>> idx.map(pser)  # doctest: +NORMALIZE_WHITESPACE
      CategoricalIndex([1, 2, 3],
                       categories=[1, 2, 3], ordered=False, dtype='category')
  
      >>> idx.map({'a': 'first', 'b': 'second', 'c': 'third'})  # doctest: +NORMALIZE_WHITESPACE
      CategoricalIndex(['first', 'second', 'third'],
                       categories=['first', 'second', 'third'], ordered=False, dtype='category')
  
      If the mapping is one-to-one the ordering of the categories is preserved:
  
      >>> idx = ps.CategoricalIndex(['a', 'b', 'c'], ordered=True)
      >>> idx  # doctest: +NORMALIZE_WHITESPACE
      CategoricalIndex(['a', 'b', 'c'],
                       categories=['a', 'b', 'c'], ordered=True, dtype='category')
  
      >>> idx.map({'a': 3, 'b': 2, 'c': 1})  # doctest: +NORMALIZE_WHITESPACE
      CategoricalIndex([3, 2, 1],
                       categories=[3, 2, 1], ordered=True, dtype='category')
  
      If the mapping is not one-to-one an `Index` is returned:
  
      >>> idx.map({'a': 'first', 'b': 'second', 'c': 'first'})
      Index(['first', 'second', 'first'], dtype='object')
  
      If a `dict` is used, all unmapped categories are mapped to None and
      the result is an `Index`:
  
      >>> idx.map({'a': 'first', 'b': 'second'})
      Index(['first', 'second', None], dtype='object')
      """
      return super().map(mapper)
  
imports: from typing import Any, Callable, List, Optional, Union, cast, no_type_check
  import pandas
  from pandas.api.types import is_hashable, CategoricalDtype
  from pyspark import pandas
  from pyspark.pandas.indexes.base import Index
  from pyspark.pandas.internal import InternalField
  from pyspark.pandas.series import Series
  from pyspark.sql.types import StructField
label_desc: Use image node_id 15 for calling the CategoricalIndex obj's underlying member method code with example usage: obj.map(mapper) and returns: super