Skip to content

DOC: Backticks missing in pandas.DataFrame.query #40400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3784,7 +3784,7 @@ def _box_col_values(self, values, loc: int) -> Series:
# Unsorted

def query(self, expr: str, inplace: bool = False, **kwargs):
"""
r"""
Query the columns of a DataFrame with a boolean expression.

Parameters
Expand All @@ -3799,8 +3799,8 @@ def query(self, expr: str, inplace: bool = False, **kwargs):
You can refer to column names that are not valid Python variable names
by surrounding them in backticks. Thus, column names containing spaces
or punctuations (besides underscores) or starting with digits must be
surrounded by backticks. (For example, a column named "Area (cm^2) would
be referenced as `Area (cm^2)`). Column names which are Python keywords
surrounded by backticks. (For example, a column named "Area (cm^2)" would
be referenced as \`Area (cm^2)\`). Column names which are Python keywords
(like "list", "for", "import", etc) cannot be used.

For example, if one of your columns is called ``a a`` and you want
Expand Down