def droplevel(self, level: Union[(int, Name, List[Union[(int, Name)]])], axis: Axis=0) -> 'DataFrame':
    '\n        Return DataFrame with requested index / column level(s) removed.\n\n        Parameters\n        ----------\n        level: int, str, or list-like\n            If a string is given, must be the name of a level If list-like, elements must\n            be names or positional indexes of levels.\n\n        axis: {0 or ‘index’, 1 or ‘columns’}, default 0\n\n        Returns\n        -------\n        DataFrame with requested index / column level(s) removed.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame(\n        ...     [[3, 4], [7, 8], [11, 12]],\n        ...     index=pd.MultiIndex.from_tuples([(1, 2), (5, 6), (9, 10)], names=["a", "b"]),\n        ... )\n\n        >>> df.columns = pd.MultiIndex.from_tuples([\n        ...   (\'c\', \'e\'), (\'d\', \'f\')\n        ... ], names=[\'level_1\', \'level_2\'])\n\n        >>> df  # doctest: +NORMALIZE_WHITESPACE\n        level_1   c   d\n        level_2   e   f\n        a b\n        1 2      3   4\n        5 6      7   8\n        9 10    11  12\n\n        >>> df.droplevel(\'a\')  # doctest: +NORMALIZE_WHITESPACE\n        level_1   c   d\n        level_2   e   f\n        b\n        2        3   4\n        6        7   8\n        10      11  12\n\n        >>> df.droplevel(\'level_2\', axis=1)  # doctest: +NORMALIZE_WHITESPACE\n        level_1   c   d\n        a b\n        1 2      3   4\n        5 6      7   8\n        9 10    11  12\n        '
    axis = validate_axis(axis)
    if (axis == 0):
        if (not isinstance(level, (tuple, list))):
            level = [level]
        names = self.index.names
        nlevels = self._internal.index_level
        int_level = set()
        for n in level:
            if isinstance(n, int):
                if (n < 0):
                    n = (n + nlevels)
                    if (n < 0):
                        raise IndexError('Too many levels: Index has only {} levels, {} is not a valid level number'.format(nlevels, (n - nlevels)))
                if (n >= nlevels):
                    raise IndexError('Too many levels: Index has only {} levels, not {}'.format(nlevels, (n + 1)))
            else:
                if (n not in names):
                    raise KeyError('Level {} not found'.format(n))
                n = names.index(n)
            int_level.add(n)
        if (len(level) >= nlevels):
            raise ValueError('Cannot remove {} levels from an index with {} levels: at least one level must be left.'.format(len(level), nlevels))
        (index_spark_columns, index_names, index_fields) = zip(*[item for (i, item) in enumerate(zip(self._internal.index_spark_columns, self._internal.index_names, self._internal.index_fields)) if (i not in int_level)])
        internal = self._internal.copy(index_spark_columns=list(index_spark_columns), index_names=list(index_names), index_fields=list(index_fields))
        return DataFrame(internal)
    else:
        psdf = self.copy()
        psdf.columns = psdf.columns.droplevel(level)
        return psdf
Return DataFrame with requested index / column level(s) removed.

Parameters
----------
level: int, str, or list-like
    If a string is given, must be the name of a level If list-like, elements must
    be names or positional indexes of levels.

axis: {0 or ‘index’, 1 or ‘columns’}, default 0

Returns
-------
DataFrame with requested index / column level(s) removed.

Examples
--------
>>> df = ps.DataFrame(
...     [[3, 4], [7, 8], [11, 12]],
...     index=pd.MultiIndex.from_tuples([(1, 2), (5, 6), (9, 10)], names=["a", "b"]),
... )

>>> df.columns = pd.MultiIndex.from_tuples([
...   ('c', 'e'), ('d', 'f')
... ], names=['level_1', 'level_2'])

>>> df  # doctest: +NORMALIZE_WHITESPACE
level_1   c   d
level_2   e   f
a b
1 2      3   4
5 6      7   8
9 10    11  12

>>> df.droplevel('a')  # doctest: +NORMALIZE_WHITESPACE
level_1   c   d
level_2   e   f
b
2        3   4
6        7   8
10      11  12

>>> df.droplevel('level_2', axis=1)  # doctest: +NORMALIZE_WHITESPACE
level_1   c   d
a b
1 2      3   4
5 6      7   8
9 10    11  12
def droplevel(self, level: Union[(int, Name, List[Union[(int, Name)]])], axis: Axis=0) -> 'DataFrame':
    '\n        Return DataFrame with requested index / column level(s) removed.\n\n        Parameters\n        ----------\n        level: int, str, or list-like\n            If a string is given, must be the name of a level If list-like, elements must\n            be names or positional indexes of levels.\n\n        axis: {0 or ‘index’, 1 or ‘columns’}, default 0\n\n        Returns\n        -------\n        DataFrame with requested index / column level(s) removed.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame(\n        ...     [[3, 4], [7, 8], [11, 12]],\n        ...     index=pd.MultiIndex.from_tuples([(1, 2), (5, 6), (9, 10)], names=["a", "b"]),\n        ... )\n\n        >>> df.columns = pd.MultiIndex.from_tuples([\n        ...   (\'c\', \'e\'), (\'d\', \'f\')\n        ... ], names=[\'level_1\', \'level_2\'])\n\n        >>> df  # doctest: +NORMALIZE_WHITESPACE\n        level_1   c   d\n        level_2   e   f\n        a b\n        1 2      3   4\n        5 6      7   8\n        9 10    11  12\n\n        >>> df.droplevel(\'a\')  # doctest: +NORMALIZE_WHITESPACE\n        level_1   c   d\n        level_2   e   f\n        b\n        2        3   4\n        6        7   8\n        10      11  12\n\n        >>> df.droplevel(\'level_2\', axis=1)  # doctest: +NORMALIZE_WHITESPACE\n        level_1   c   d\n        a b\n        1 2      3   4\n        5 6      7   8\n        9 10    11  12\n        '
    axis = validate_axis(axis)
    if (axis == 0):
        if (not isinstance(level, (tuple, list))):
            level = [level]
        names = self.index.names
        nlevels = self._internal.index_level
        int_level = set()
        for n in level:
            if isinstance(n, int):
                if (n < 0):
                    n = (n + nlevels)
                    if (n < 0):
                        raise IndexError('Too many levels: Index has only {} levels, {} is not a valid level number'.format(nlevels, (n - nlevels)))
                if (n >= nlevels):
                    raise IndexError('Too many levels: Index has only {} levels, not {}'.format(nlevels, (n + 1)))
            else:
                if (n not in names):
                    raise KeyError('Level {} not found'.format(n))
                n = names.index(n)
            int_level.add(n)
        if (len(level) >= nlevels):
            raise ValueError('Cannot remove {} levels from an index with {} levels: at least one level must be left.'.format(len(level), nlevels))
        (index_spark_columns, index_names, index_fields) = zip(*[item for (i, item) in enumerate(zip(self._internal.index_spark_columns, self._internal.index_names, self._internal.index_fields)) if (i not in int_level)])
        internal = self._internal.copy(index_spark_columns=list(index_spark_columns), index_names=list(index_names), index_fields=list(index_fields))
        return DataFrame(internal)
    else:
        psdf = self.copy()
        psdf.columns = psdf.columns.droplevel(level)
        return psdf