pandas.errors.NumExprClobberingError — pandas 3.0.0rc0+33.g1fd184de2a documentation (original) (raw)
exception pandas.errors.NumExprClobberingError[source]#
Exception raised when trying to use a built-in numexpr name as a variable name.
eval or query will throw the error if the engine is set to ‘numexpr’. ‘numexpr’ is the default engine value for these methods if the numexpr package is installed.
See also
Evaluate a Python expression as a string using various backends.
DataFrame.query
Query the columns of a DataFrame with a boolean expression.
Examples
df = pd.DataFrame({"abs": [1, 1, 1]}) df.query("abs > 2") ... # NumExprClobberingError: Variables in expression "(abs) > (2)" overlap... sin, a = 1, 2 pd.eval("sin + a", engine="numexpr") ... # NumExprClobberingError: Variables in expression "(sin) + (a)" overlap...