(df, labels=None, axis=0, index=None, columns=None, level=None, inplace=False,
                              errors='raise')
return sdc_pandas_dataframe_drop_impl(df, args, columns)
Intel Scalable Dataframe Compiler User Guide
    ********************************************
    Pandas API: pandas.DataFrame.drop

    Limitations
    -----------
    - Parameters ``labels``, ``axis``, ``index``, ``level`` and ``inplace`` are currently unsupported.
    - Parameter ``columns`` is required and is expected to be a Literal value with one column name
    or List with columns names. Mutating a list of column names after it was defined and then using it as a
    columns argument results in an SDCLimitation exception at runtime.
    - Supported ``errors`` can be {``raise``, ``ignore``}, default ``raise``. If ``ignore``, suppress error and only
    existing labels are dropped.

    Examples
    --------
    .. literalinclude:: ../../../examples/dataframe/dataframe_drop.py
        :language: python
        :lines: 37-
        :caption: Drop specified columns from DataFrame.
        :name: ex_dataframe_drop

    .. command-output:: python ./dataframe/dataframe_drop.py
        :cwd: ../../../examples

    .. seealso::
        :ref:`DataFrame.loc <pandas.DataFrame.loc>`
            Label-location based indexer for selection by label.
        :ref:`DataFrame.dropna <pandas.DataFrame.dropna>`
            Return DataFrame with labels on given axis omitted where (all or any) data are missing.
        :ref:`DataFrame.drop_duplicates <pandas.DataFrame.drop_duplicates>`
            Return DataFrame with duplicate rows removed, optionally only considering certain columns.
        :ref:`Series.drop <pandas.Series.drop>`
            Return Series with specified index labels removed.

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************
    Pandas DataFrame method :meth:`pandas.DataFrame.drop` implementation.
    .. only:: developer
    Test: python -m sdc.runtests -k sdc.tests.test_dataframe.TestDataFrame.test_df_drop*
Intel Scalable Dataframe Compiler User Guide
    ********************************************
    Pandas API: pandas.DataFrame.drop
Intel Scalable Dataframe Compiler User Guide ******************************************** Pandas API : pandas . DataFrame . drop
def sdc_pandas_dataframe_drop(df, labels=None, axis=0, index=None, columns=None, level=None, inplace=False,
                              errors='raise'):
    """
    Intel Scalable Dataframe Compiler User Guide
    ********************************************
    Pandas API: pandas.DataFrame.drop

    Limitations
    -----------
    - Parameters ``labels``, ``axis``, ``index``, ``level`` and ``inplace`` are currently unsupported.
    - Parameter ``columns`` is required and is expected to be a Literal value with one column name
    or List with columns names. Mutating a list of column names after it was defined and then using it as a
    columns argument results in an SDCLimitation exception at runtime.
    - Supported ``errors`` can be {``raise``, ``ignore``}, default ``raise``. If ``ignore``, suppress error and only
    existing labels are dropped.

    Examples
    --------
    .. literalinclude:: ../../../examples/dataframe/dataframe_drop.py
        :language: python
        :lines: 37-
        :caption: Drop specified columns from DataFrame.
        :name: ex_dataframe_drop

    .. command-output:: python ./dataframe/dataframe_drop.py
        :cwd: ../../../examples

    .. seealso::
        :ref:`DataFrame.loc <pandas.DataFrame.loc>`
            Label-location based indexer for selection by label.
        :ref:`DataFrame.dropna <pandas.DataFrame.dropna>`
            Return DataFrame with labels on given axis omitted where (all or any) data are missing.
        :ref:`DataFrame.drop_duplicates <pandas.DataFrame.drop_duplicates>`
            Return DataFrame with duplicate rows removed, optionally only considering certain columns.
        :ref:`Series.drop <pandas.Series.drop>`
            Return Series with specified index labels removed.

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************
    Pandas DataFrame method :meth:`pandas.DataFrame.drop` implementation.
    .. only:: developer
    Test: python -m sdc.runtests -k sdc.tests.test_dataframe.TestDataFrame.test_df_drop*

    """

    method_name = f'Method drop().'

    ty_checker = TypeChecker(method_name)
    ty_checker.check(df, DataFrameType)

    if not isinstance(labels, (types.Omitted, types.NoneType)) and labels is not None:
        ty_checker.raise_exc(labels, 'None', 'labels')

    if not isinstance(axis, (types.Omitted, types.Integer)) and axis != 0:
        ty_checker.raise_exc(axis, 'int', 'axis')

    if not isinstance(index, (types.Omitted, types.NoneType)) and index is not None:
        ty_checker.raise_exc(index, 'None', 'index')

    if not (isinstance(columns, (types.Omitted, types.StringLiteral))
            or (isinstance(columns, types.Tuple)
                and all(isinstance(c, types.StringLiteral) for c in columns))
            or (isinstance(columns, types.UniTuple) and isinstance(columns.dtype, types.StringLiteral))
            or isinstance(columns, types.List) and isinstance(columns.dtype, types.UnicodeType)
            ):
        ty_checker.raise_exc(columns, 'str, list of const str', 'columns')

    if not isinstance(level, (types.Omitted, types.NoneType, types.Literal)) and level is not None:
        ty_checker.raise_exc(level, 'None', 'level')

    if not isinstance(inplace, (types.Omitted, types.NoneType, types.Boolean)) and inplace:
        ty_checker.raise_exc(inplace, 'bool', 'inplace')

    if not isinstance(errors, (types.Omitted, types.UnicodeType, types.StringLiteral)) and errors != "raise":
        ty_checker.raise_exc(errors, 'str', 'errors')

    if isinstance(columns, types.List):
        if columns.initial_value is None:
            raise TypingError('{} Unsupported use of parameter columns:'
                              ' expected list of constant strings. Given: {}'.format(method_name, columns))
        else:
            # this works because global tuple of strings is captured as Tuple of StringLiterals
            columns_as_tuple = tuple(columns.initial_value)

            def _sdc_pandas_dataframe_drop_wrapper_impl(df, labels=None, axis=0, index=None,
                                                        columns=None, level=None, inplace=False, errors="raise"):

                # if at runtime columns list differs from it's initial value (known at compile time)
                # we cannot tell which columns to drop and what is the resulting DataFrameType, so raise exception
                if list(columns_as_tuple) != columns:
                    raise SDCLimitation("Unsupported use of parameter columns: non-const list was used.")

                return df.drop(labels=labels,
                               axis=axis,
                               index=index,
                               columns=columns_as_tuple,
                               level=level,
                               inplace=inplace,
                               errors=errors)

            return _sdc_pandas_dataframe_drop_wrapper_impl

    args = {'labels': None, 'axis': 0, 'index': None, 'columns': None, 'level': None, 'inplace': False,
            'errors': f'"raise"'}

    def sdc_pandas_dataframe_drop_impl(df, args, columns):
        func_args = ['df']
        for key, value in args.items():
            if key not in func_args:
                if isinstance(value, types.Literal):
                    value = value.literal_value
                func_args.append(f'{key}={value}')

        if isinstance(columns, types.StringLiteral):
            drop_cols = (columns.literal_value,)
        elif isinstance(columns, (types.Tuple, types.UniTuple)):
            drop_cols = tuple(column.literal_value for column in columns)
        else:
            raise ValueError('Only drop by one column or tuple of columns is currently supported in df.drop()')

        func_name = 'sdc_pandas_dataframe_drop_impl'
        func_def, global_vars = sdc_pandas_dataframe_drop_codegen(func_name, func_args, df, drop_cols)
        loc_vars = {}
        exec(func_def, global_vars, loc_vars)
        _drop_impl = loc_vars[func_name]
        return _drop_impl

    return sdc_pandas_dataframe_drop_impl(df, args, columns)
def sdc_pandas_dataframe_drop ( df , labels = None , axis = 0 , index = None , columns = None , level = None , inplace = False , errors = 'raise' ) : method_name = f'Method drop().' ty_checker = TypeChecker ( method_name ) ty_checker . check ( df , DataFrameType ) if not isinstance ( labels , ( types . Omitted , types . NoneType ) ) and labels is not None : ty_checker . raise_exc ( labels , 'None' , 'labels' ) if not isinstance ( axis , ( types . Omitted , types . Integer ) ) and axis != 0 : ty_checker . raise_exc ( axis , 'int' , 'axis' ) if not isinstance ( index , ( types . Omitted , types . NoneType ) ) and index is not None : ty_checker . raise_exc ( index , 'None' , 'index' ) if not ( isinstance ( columns , ( types . Omitted , types . StringLiteral ) ) or ( isinstance ( columns , types . Tuple ) and all ( isinstance ( c , types . StringLiteral ) for c in columns ) ) or ( isinstance ( columns , types . UniTuple ) and isinstance ( columns . dtype , types . StringLiteral ) ) or isinstance ( columns , types . List ) and isinstance ( columns . dtype , types . UnicodeType ) ) : ty_checker . raise_exc ( columns , 'str, list of const str' , 'columns' ) if not isinstance ( level , ( types . Omitted , types . NoneType , types . Literal ) ) and level is not None : ty_checker . raise_exc ( level , 'None' , 'level' ) if not isinstance ( inplace , ( types . Omitted , types . NoneType , types . Boolean ) ) and inplace : ty_checker . raise_exc ( inplace , 'bool' , 'inplace' ) if not isinstance ( errors , ( types . Omitted , types . UnicodeType , types . StringLiteral ) ) and errors != "raise" : ty_checker . raise_exc ( errors , 'str' , 'errors' ) if isinstance ( columns , types . List ) : if columns . initial_value is None : raise TypingError ( '{} Unsupported use of parameter columns:' ' expected list of constant strings. Given: {}' . format ( method_name , columns ) ) else : # this works because global tuple of strings is captured as Tuple of StringLiterals columns_as_tuple = tuple ( columns . initial_value ) def _sdc_pandas_dataframe_drop_wrapper_impl ( df , labels = None , axis = 0 , index = None , columns = None , level = None , inplace = False , errors = "raise" ) : # if at runtime columns list differs from it's initial value (known at compile time) # we cannot tell which columns to drop and what is the resulting DataFrameType, so raise exception if list ( columns_as_tuple ) != columns : raise SDCLimitation ( "Unsupported use of parameter columns: non-const list was used." ) return df . drop ( labels = labels , axis = axis , index = index , columns = columns_as_tuple , level = level , inplace = inplace , errors = errors ) return _sdc_pandas_dataframe_drop_wrapper_impl args = { 'labels' : None , 'axis' : 0 , 'index' : None , 'columns' : None , 'level' : None , 'inplace' : False , 'errors' : f'"raise"' } def sdc_pandas_dataframe_drop_impl ( df , args , columns ) : func_args = [ 'df' ] for key , value in args . items ( ) : if key not in func_args : if isinstance ( value , types . Literal ) : value = value . literal_value func_args . append ( f'{key}={value}' ) if isinstance ( columns , types . StringLiteral ) : drop_cols = ( columns . literal_value , ) elif isinstance ( columns , ( types . Tuple , types . UniTuple ) ) : drop_cols = tuple ( column . literal_value for column in columns ) else : raise ValueError ( 'Only drop by one column or tuple of columns is currently supported in df.drop()' ) func_name = 'sdc_pandas_dataframe_drop_impl' func_def , global_vars = sdc_pandas_dataframe_drop_codegen ( func_name , func_args , df , drop_cols ) loc_vars = { } exec ( func_def , global_vars , loc_vars ) _drop_impl = loc_vars [ func_name ] return _drop_impl return sdc_pandas_dataframe_drop_impl ( df , args , columns )