def sort_index(self, axis: Axis=0, level: Optional[Union[(int, List[int])]]=None, ascending: bool=True, inplace: bool=False, kind: str=None, na_position: str='last') -> Optional['DataFrame']:
    "\n        Sort object by labels (along an axis)\n\n        Parameters\n        ----------\n        axis : index, columns to direct sorting. Currently, only axis = 0 is supported.\n        level : int or level name or list of ints or list of level names\n            if not None, sort on values in specified index level(s)\n        ascending : boolean, default True\n            Sort ascending vs. descending\n        inplace : bool, default False\n            if True, perform operation in-place\n        kind : str, default None\n            pandas-on-Spark does not allow specifying the sorting algorithm at the moment,\n            default None\n        na_position : {‘first’, ‘last’}, default ‘last’\n            first puts NaNs at the beginning, last puts NaNs at the end. Not implemented for\n            MultiIndex.\n\n        Returns\n        -------\n        sorted_obj : DataFrame\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'A': [2, 1, np.nan]}, index=['b', 'a', np.nan])\n\n        >>> df.sort_index()\n               A\n        a    1.0\n        b    2.0\n        NaN  NaN\n\n        >>> df.sort_index(ascending=False)\n               A\n        b    2.0\n        a    1.0\n        NaN  NaN\n\n        >>> df.sort_index(na_position='first')\n               A\n        NaN  NaN\n        a    1.0\n        b    2.0\n\n        >>> df.sort_index(inplace=True)\n        >>> df\n               A\n        a    1.0\n        b    2.0\n        NaN  NaN\n\n        >>> df = ps.DataFrame({'A': range(4), 'B': range(4)[::-1]},\n        ...                   index=[['b', 'b', 'a', 'a'], [1, 0, 1, 0]],\n        ...                   columns=['A', 'B'])\n\n        >>> df.sort_index()\n             A  B\n        a 0  3  0\n          1  2  1\n        b 0  1  2\n          1  0  3\n\n        >>> df.sort_index(level=1)  # doctest: +SKIP\n             A  B\n        a 0  3  0\n        b 0  1  2\n        a 1  2  1\n        b 1  0  3\n\n        >>> df.sort_index(level=[1, 0])\n             A  B\n        a 0  3  0\n        b 0  1  2\n        a 1  2  1\n        b 1  0  3\n        "
    inplace = validate_bool_kwarg(inplace, 'inplace')
    axis = validate_axis(axis)
    if (axis != 0):
        raise NotImplementedError('No other axis than 0 are supported at the moment')
    if (kind is not None):
        raise NotImplementedError('Specifying the sorting algorithm is not supported at the moment.')
    if ((level is None) or (is_list_like(level) and (len(level) == 0))):
        by = self._internal.index_spark_columns
    elif is_list_like(level):
        by = [self._internal.index_spark_columns[lvl] for lvl in level]
    else:
        by = [self._internal.index_spark_columns[level]]
    psdf = self._sort(by=by, ascending=ascending, na_position=na_position)
    if inplace:
        self._update_internal_frame(psdf._internal)
        return None
    else:
        return psdf
Sort object by labels (along an axis)

Parameters
----------
axis : index, columns to direct sorting. Currently, only axis = 0 is supported.
level : int or level name or list of ints or list of level names
    if not None, sort on values in specified index level(s)
ascending : boolean, default True
    Sort ascending vs. descending
inplace : bool, default False
    if True, perform operation in-place
kind : str, default None
    pandas-on-Spark does not allow specifying the sorting algorithm at the moment,
    default None
na_position : {‘first’, ‘last’}, default ‘last’
    first puts NaNs at the beginning, last puts NaNs at the end. Not implemented for
    MultiIndex.

Returns
-------
sorted_obj : DataFrame

Examples
--------
>>> df = ps.DataFrame({'A': [2, 1, np.nan]}, index=['b', 'a', np.nan])

>>> df.sort_index()
       A
a    1.0
b    2.0
NaN  NaN

>>> df.sort_index(ascending=False)
       A
b    2.0
a    1.0
NaN  NaN

>>> df.sort_index(na_position='first')
       A
NaN  NaN
a    1.0
b    2.0

>>> df.sort_index(inplace=True)
>>> df
       A
a    1.0
b    2.0
NaN  NaN

>>> df = ps.DataFrame({'A': range(4), 'B': range(4)[::-1]},
...                   index=[['b', 'b', 'a', 'a'], [1, 0, 1, 0]],
...                   columns=['A', 'B'])

>>> df.sort_index()
     A  B
a 0  3  0
  1  2  1
b 0  1  2
  1  0  3

>>> df.sort_index(level=1)  # doctest: +SKIP
     A  B
a 0  3  0
b 0  1  2
a 1  2  1
b 1  0  3

>>> df.sort_index(level=[1, 0])
     A  B
a 0  3  0
b 0  1  2
a 1  2  1
b 1  0  3
def sort_index(self, axis: Axis=0, level: Optional[Union[(int, List[int])]]=None, ascending: bool=True, inplace: bool=False, kind: str=None, na_position: str='last') -> Optional['DataFrame']:
    "\n        Sort object by labels (along an axis)\n\n        Parameters\n        ----------\n        axis : index, columns to direct sorting. Currently, only axis = 0 is supported.\n        level : int or level name or list of ints or list of level names\n            if not None, sort on values in specified index level(s)\n        ascending : boolean, default True\n            Sort ascending vs. descending\n        inplace : bool, default False\n            if True, perform operation in-place\n        kind : str, default None\n            pandas-on-Spark does not allow specifying the sorting algorithm at the moment,\n            default None\n        na_position : {‘first’, ‘last’}, default ‘last’\n            first puts NaNs at the beginning, last puts NaNs at the end. Not implemented for\n            MultiIndex.\n\n        Returns\n        -------\n        sorted_obj : DataFrame\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'A': [2, 1, np.nan]}, index=['b', 'a', np.nan])\n\n        >>> df.sort_index()\n               A\n        a    1.0\n        b    2.0\n        NaN  NaN\n\n        >>> df.sort_index(ascending=False)\n               A\n        b    2.0\n        a    1.0\n        NaN  NaN\n\n        >>> df.sort_index(na_position='first')\n               A\n        NaN  NaN\n        a    1.0\n        b    2.0\n\n        >>> df.sort_index(inplace=True)\n        >>> df\n               A\n        a    1.0\n        b    2.0\n        NaN  NaN\n\n        >>> df = ps.DataFrame({'A': range(4), 'B': range(4)[::-1]},\n        ...                   index=[['b', 'b', 'a', 'a'], [1, 0, 1, 0]],\n        ...                   columns=['A', 'B'])\n\n        >>> df.sort_index()\n             A  B\n        a 0  3  0\n          1  2  1\n        b 0  1  2\n          1  0  3\n\n        >>> df.sort_index(level=1)  # doctest: +SKIP\n             A  B\n        a 0  3  0\n        b 0  1  2\n        a 1  2  1\n        b 1  0  3\n\n        >>> df.sort_index(level=[1, 0])\n             A  B\n        a 0  3  0\n        b 0  1  2\n        a 1  2  1\n        b 1  0  3\n        "
    inplace = validate_bool_kwarg(inplace, 'inplace')
    axis = validate_axis(axis)
    if (axis != 0):
        raise NotImplementedError('No other axis than 0 are supported at the moment')
    if (kind is not None):
        raise NotImplementedError('Specifying the sorting algorithm is not supported at the moment.')
    if ((level is None) or (is_list_like(level) and (len(level) == 0))):
        by = self._internal.index_spark_columns
    elif is_list_like(level):
        by = [self._internal.index_spark_columns[lvl] for lvl in level]
    else:
        by = [self._internal.index_spark_columns[level]]
    psdf = self._sort(by=by, ascending=ascending, na_position=na_position)
    if inplace:
        self._update_internal_frame(psdf._internal)
        return None
    else:
        return psdf