@@ -4486,7 +4486,6 @@ def query(
4486
4486
global_dict : dict [str , Any ] | None = ...,
4487
4487
resolvers : list [Mapping ] | None = ...,
4488
4488
level : int = ...,
4489
- target : None = ...,
4490
4489
inplace : Literal [False ] = ...,
4491
4490
) -> DataFrame : ...
4492
4491
@@ -4501,7 +4500,6 @@ def query(
4501
4500
global_dict : dict [str , Any ] | None = ...,
4502
4501
resolvers : list [Mapping ] | None = ...,
4503
4502
level : int = ...,
4504
- target : None = ...,
4505
4503
inplace : Literal [True ],
4506
4504
) -> None : ...
4507
4505
@@ -4516,7 +4514,6 @@ def query(
4516
4514
global_dict : dict [str , Any ] | None = ...,
4517
4515
resolvers : list [Mapping ] | None = ...,
4518
4516
level : int = ...,
4519
- target : None = ...,
4520
4517
inplace : bool = ...,
4521
4518
) -> DataFrame | None : ...
4522
4519
@@ -4530,7 +4527,6 @@ def query(
4530
4527
global_dict : dict [str , Any ] | None = None ,
4531
4528
resolvers : list [Mapping ] | None = None ,
4532
4529
level : int = 0 ,
4533
- target : None = None ,
4534
4530
inplace : bool = False ,
4535
4531
) -> DataFrame | None :
4536
4532
"""
@@ -4551,11 +4547,45 @@ def query(
4551
4547
4552
4548
See the documentation for :meth:`DataFrame.eval` for details on
4553
4549
referring to column names and variables in the query string.
4550
+ parser : {'pandas', 'python'}, default 'pandas'
4551
+ The parser to use to construct the syntax tree from the expression. The
4552
+ default of ``'pandas'`` parses code slightly different than standard
4553
+ Python. Alternatively, you can parse an expression using the
4554
+ ``'python'`` parser to retain strict Python semantics. See the
4555
+ :ref:`enhancing performance <enhancingperf.eval>` documentation for
4556
+ more details.
4557
+ engine : {'python', 'numexpr'}, default 'numexpr'
4558
+
4559
+ The engine used to evaluate the expression. Supported engines are
4560
+
4561
+ - None : tries to use ``numexpr``, falls back to ``python``
4562
+ - ``'numexpr'`` : This default engine evaluates pandas objects using
4563
+ numexpr for large speed ups in complex expressions with large frames.
4564
+ - ``'python'`` : Performs operations as if you had ``eval``'d in top
4565
+ level python. This engine is generally not that useful.
4566
+
4567
+ More backends may be available in the future.
4568
+ local_dict : dict or None, optional
4569
+ A dictionary of local variables, taken from locals() by default.
4570
+ global_dict : dict or None, optional
4571
+ A dictionary of global variables, taken from globals() by default.
4572
+ resolvers : list of dict-like or None, optional
4573
+ A list of objects implementing the ``__getitem__`` special method that
4574
+ you can use to inject an additional collection of namespaces to use for
4575
+ variable lookup. For example, this is used in the
4576
+ :meth:`~DataFrame.query` method to inject the
4577
+ ``DataFrame.index`` and ``DataFrame.columns``
4578
+ variables that refer to their respective :class:`~pandas.DataFrame`
4579
+ instance attributes.
4580
+ level : int, optional
4581
+ The number of prior stack frames to traverse and add to the current
4582
+ scope. Most users will **not** need to change this parameter.
4583
+ inplace : bool, default False
4584
+ If `target` is provided, and the expression mutates `target`, whether
4585
+ to modify `target` inplace. Otherwise, return a copy of `target` with
4586
+ the mutation.
4554
4587
inplace : bool
4555
4588
Whether to modify the DataFrame rather than creating a new one.
4556
- **kwargs
4557
- See the documentation for :func:`eval` for complete details
4558
- on the keyword arguments accepted by :meth:`DataFrame.query`.
4559
4589
4560
4590
Returns
4561
4591
-------
0 commit comments