You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pandas.computation.ops.UndefinedVariableError: name 'pi' is not defined
According to the documentation of pd.eval which is used by pd.DataFrame.eval,
globals should be available:
local_dict : dict or None, optional
A dictionary of local variables, taken from locals() by default.
global_dict : dict or None, optional
A dictionary of global variables, taken from globals() by default.
The same exception is raised even if global_dict=globals() is passed to eval explicitly.
* updating df.query and df.eval docstrings. resolves#16283
* typo
* adding 1 example
* changing wording following example added
* updating 'C C' to 'C&C' for eval
* updating 'C C' to 'C&C' for query
---------
Co-authored-by: Laurent Mutricy <[email protected]>
Code Sample, a copy-pastable example if possible
Problem description
This raises a
According to the documentation of
pd.eval
which is used bypd.DataFrame.eval
,globals should be available:
The same exception is raised even if
global_dict=globals()
is passed to eval explicitly.The only solution I found was to use:
Expected Output
No exception and the result of the calculation
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.8.0-51-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.19.2
nose: 1.3.7
pip: 9.0.1
setuptools: 35.0.1
Cython: 0.25.2
numpy: 1.12.1
scipy: 0.19.0
statsmodels: 0.8.0
xarray: None
IPython: 6.0.0
sphinx: 1.4.8
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.2
matplotlib: 2.0.1
openpyxl: 2.4.1
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: 3.7.3
bs4: 4.5.3
html5lib: 0.999
httplib2: 0.9.2
apiclient: None
sqlalchemy: 1.1.9
pymysql: 0.7.2.None
psycopg2: None
jinja2: 2.9.6
boto: 2.43.0
pandas_datareader: Non
The text was updated successfully, but these errors were encountered: