def eval(self, expr, inplace=False, **kwargs):
from pandas.core.computation.eval import eval as _eval<EOL>inplace = validate_bool_kwarg(inplace, '<STR_LIT>')<EOL>resolvers = kwargs.pop('<STR_LIT>', None)<EOL>kwargs['<STR_LIT>'] = kwargs.pop('<STR_LIT>', <NUM_LIT:0>) + <NUM_LIT:1><EOL>if resolvers is None:<EOL><INDENT>index_resolvers = self._get_index_resolvers()<EOL>column_resolvers =self._get_space_character_free_column_resolvers()<EOL>resolvers = column_resolvers, index_resolvers<EOL><DEDENT>if '<STR_LIT:target>' not in kwargs:<EOL><INDENT>kwargs['<STR_LIT:target>'] = self<EOL><DEDENT>kwargs['<STR_LIT>'] = kwargs.get('<STR_LIT>', ()) + tuple(resolvers)<EOL>return _eval(expr, inplace=inplace, **kwargs)<EOL>
Evaluate a string describing operations on DataFrame columns.

Operates on columns only, not specific rows or elements.  This allows
`eval` to run arbitrary code, which can make you vulnerable to code
injection if you pass user input to this function.

Parameters
----------
expr : str
    The expression string to evaluate.
inplace : bool, default False
    If the expression contains an assignment, whether to perform the
    operation inplace and mutate the existing DataFrame. Otherwise,
    a new DataFrame is returned.

    .. versionadded:: 0.18.0.
kwargs : dict
    See the documentation for :func:`eval` for complete details
    on the keyword arguments accepted by
    :meth:`~pandas.DataFrame.query`.

Returns
-------
ndarray, scalar, or pandas object
    The result of the evaluation.

See Also
--------
DataFrame.query : Evaluates a boolean expression to query the columns
    of a frame.
DataFrame.assign : Can evaluate an expression or function to create new
    values for a column.
eval : Evaluate a Python expression as a string using various
    backends.

Notes
-----
For more details see the API documentation for :func:`~eval`.
For detailed examples see :ref:`enhancing performance with eval
<enhancingperf.eval>`.

Examples
--------
>>> df = pd.DataFrame({'A': range(1, 6), 'B': range(10, 0, -2)})
>>> df
   A   B
0  1  10
1  2   8
2  3   6
3  4   4
4  5   2
>>> df.eval('A + B')
0    11
1    10
2     9
3     8
4     7
dtype: int64

Assignment is allowed though by default the original DataFrame is not
modified.

>>> df.eval('C = A + B')
   A   B   C
0  1  10  11
1  2   8  10
2  3   6   9
3  4   4   8
4  5   2   7
>>> df
   A   B
0  1  10
1  2   8
2  3   6
3  4   4
4  5   2

Use ``inplace=True`` to modify the original DataFrame.

>>> df.eval('C = A + B', inplace=True)
>>> df
   A   B   C
0  1  10  11
1  2   8  10
2  3   6   9
3  4   4   8
4  5   2   7