Skip to content

DOC: Fix python code error in enhancingperf #28026

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

Closed
EunSeop opened this issue Aug 20, 2019 · 0 comments · Fixed by #28029
Closed

DOC: Fix python code error in enhancingperf #28026

EunSeop opened this issue Aug 20, 2019 · 0 comments · Fixed by #28029
Labels
Milestone

Comments

@EunSeop
Copy link
Contributor

EunSeop commented Aug 20, 2019

Problem description

image

This screenshot is in pandas 0.25.0 documentation, https://pandas.pydata.org/pandas-docs/stable/user_guide/enhancingperf.html#using-ndarray

Current code is

.. ipython:: python

   %prun -l 4 apply_integrate_f(df['a'].to_numpy(),
                                df['b'].to_numpy(),
                                df['N'].to_numpy())

%prun takes only single line, so it can be

.. ipython:: python
   %prun -l 4 apply_integrate_f(df['a'].to_numpy(), df['b'].to_numpy(), df['N'].to_numpy())

or use %%prun

.. ipython:: python
   %%prun -l 4 apply_integrate_f(df['a'].to_numpy(),
                                df['b'].to_numpy(),
                                df['N'].to_numpy())

Expected Output

image

Output of pd.show_versions()

In [1]: import pandas as pd;pd.show_versions()

INSTALLED VERSIONS

commit : 5b0a2a6
python : 3.6.7.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-54-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 0.25.0+191.g5b0a2a6e3.dirty
numpy : 1.17.0
pytz : 2019.2
dateutil : 2.8.0
pip : 19.2.2
setuptools : 41.1.0
Cython : 0.29.13
pytest : 5.1.0
hypothesis : 4.32.3
sphinx : 1.8.5
blosc : 1.8.1
feather : None
xlsxwriter : None
lxml.etree : 4.4.1
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.7.0
pandas_datareader: None
bs4 : 4.8.0
bottleneck : 1.2.1
fastparquet : 0.3.2
gcsfs : None
lxml.etree : 4.4.1
matplotlib : 3.1.1
numexpr : 2.7.0
odfpy : None
openpyxl : 2.6.2
pandas_gbq : None
pyarrow : 0.14.1
pytables : None
s3fs : None
scipy : 1.3.1
sqlalchemy : None
tables : 3.5.2
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants