1
1
#!/usr/bin/env python
2
2
3
- """Top level ``eval`` module.
3
+ """
4
+ Top level ``eval`` module.
4
5
"""
5
6
6
7
import tokenize
15
16
16
17
17
18
def _check_engine (engine ):
18
- """Make sure a valid engine is passed.
19
+ """
20
+ Make sure a valid engine is passed.
19
21
20
22
Parameters
21
23
----------
@@ -31,7 +33,6 @@ def _check_engine(engine):
31
33
Returns
32
34
-------
33
35
string engine
34
-
35
36
"""
36
37
from pandas .core .computation .check import _NUMEXPR_INSTALLED
37
38
@@ -60,7 +61,8 @@ def _check_engine(engine):
60
61
61
62
62
63
def _check_parser (parser ):
63
- """Make sure a valid parser is passed.
64
+ """
65
+ Make sure a valid parser is passed.
64
66
65
67
Parameters
66
68
----------
@@ -88,7 +90,8 @@ def _check_resolvers(resolvers):
88
90
89
91
90
92
def _check_expression (expr ):
91
- """Make sure an expression is not an empty string
93
+ """
94
+ Make sure an expression is not an empty string
92
95
93
96
Parameters
94
97
----------
@@ -105,7 +108,8 @@ def _check_expression(expr):
105
108
106
109
107
110
def _convert_expression (expr ):
108
- """Convert an object to an expression.
111
+ """
112
+ Convert an object to an expression.
109
113
110
114
Thus function converts an object to an expression (a unicode string) and
111
115
checks to make sure it isn't empty after conversion. This is used to
@@ -155,7 +159,8 @@ def _check_for_locals(expr, stack_level, parser):
155
159
def eval (expr , parser = 'pandas' , engine = None , truediv = True ,
156
160
local_dict = None , global_dict = None , resolvers = (), level = 0 ,
157
161
target = None , inplace = False ):
158
- """Evaluate a Python expression as a string using various backends.
162
+ """
163
+ Evaluate a Python expression as a string using various backends.
159
164
160
165
The following arithmetic operations are supported: ``+``, ``-``, ``*``,
161
166
``/``, ``**``, ``%``, ``//`` (python engine only) along with the following
0 commit comments