Description
Location of the documentation
Documentation problem
The expr
parameter is described as follows:
You can refer to column names that contain spaces or operators by surrounding them in backticks. This way you can also escape names that start with a digit, or those that are a Python keyword. Basically when it is not valid Python identifier. See notes down for more details.
However, the notes that follow indicate:
Python keywords may not be used as identifiers.
So the first part suggests Python keywords can be used, while the second part indicates they cannot. Testing suggests they cannot currently be used.
Suggested fix for documentation
Change the expr
description to read:
You can refer to column names that are not valid Python variable names by surrounding them in backticks. Thus column names containing spaces or punctuation (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 (like "list", "for", "import", etc) cannot be used.