|
3 | 3 | """Top level ``eval`` module. |
4 | 4 | """ |
5 | 5 |
|
6 | | -import warnings |
7 | 6 | import tokenize |
8 | 7 | from pandas.io.formats.printing import pprint_thing |
9 | 8 | from pandas.core.computation import _NUMEXPR_INSTALLED |
@@ -148,7 +147,7 @@ def _check_for_locals(expr, stack_level, parser): |
148 | 147 |
|
149 | 148 | def eval(expr, parser='pandas', engine=None, truediv=True, |
150 | 149 | local_dict=None, global_dict=None, resolvers=(), level=0, |
151 | | - target=None, inplace=None): |
| 150 | + target=None, inplace=False): |
152 | 151 | """Evaluate a Python expression as a string using various backends. |
153 | 152 |
|
154 | 153 | The following arithmetic operations are supported: ``+``, ``-``, ``*``, |
@@ -207,13 +206,10 @@ def eval(expr, parser='pandas', engine=None, truediv=True, |
207 | 206 | scope. Most users will **not** need to change this parameter. |
208 | 207 | target : a target object for assignment, optional, default is None |
209 | 208 | essentially this is a passed in resolver |
210 | | - inplace : bool, default True |
211 | | - If expression mutates, whether to modify object inplace or return |
212 | | - copy with mutation. |
213 | | -
|
214 | | - WARNING: inplace=None currently falls back to to True, but |
215 | | - in a future version, will default to False. Use inplace=True |
216 | | - explicitly rather than relying on the default. |
| 209 | + inplace : bool, default False |
| 210 | + If the expression mutates, whether to modify the expression inplace |
| 211 | + or return a copy of it with mutation. In other words, it will return |
| 212 | + the result of the expression if `inplace=True` and `target` otherwise. |
217 | 213 |
|
218 | 214 | Returns |
219 | 215 | ------- |
@@ -272,14 +268,6 @@ def eval(expr, parser='pandas', engine=None, truediv=True, |
272 | 268 |
|
273 | 269 | # assign if needed |
274 | 270 | if env.target is not None and parsed_expr.assigner is not None: |
275 | | - if inplace is None: |
276 | | - warnings.warn( |
277 | | - "eval expressions containing an assignment currently" |
278 | | - "default to operating inplace.\nThis will change in " |
279 | | - "a future version of pandas, use inplace=True to " |
280 | | - "avoid this warning.", |
281 | | - FutureWarning, stacklevel=3) |
282 | | - inplace = True |
283 | 271 |
|
284 | 272 | # if returning a copy, copy only on the first assignment |
285 | 273 | if not inplace and first_expr: |
|
0 commit comments