question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jupyter Notebook displays Series VERY slowly

See original GitHub issue

Code Sample

import pandas as pd
from IPython.display import display
df = pd.DataFrame(
    pd.np.random.random((10000000, 1)), 
    columns=['a'], 
    index=pd.date_range(start='2001-01-01', freq='min', periods=10000000)
)
display(df.a)
import pandas as pd
from IPython.display import display

# read some data for size 200,000 x 4

display(data.loc[:, ['reading']])  #25ms
display(data.reading.to_frame())  #25ms
display(data.reading) #3.53s
s = data.reading
display(s) #3.32s possibly cached
print(data.reading) #9ms
print(data.loc[:, ['reading']]) # 15ms

Problem description

In the Jupyter notebook, displaying a pd.Series is VERY slow. It is displays quicker when kept as a pd.DataFrame but is of course more verbose.

Expected Output

A pd.Series display/print out at reasonable speeds.

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None python: 3.5.4.final.0 python-bits: 64 OS: Windows OS-release: 7 machine: AMD64 processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None

pandas: 0.21.0 pytest: 3.2.1 pip: 9.0.1 setuptools: 36.2.4 Cython: 0.26 numpy: 1.13.3 scipy: 0.19.1 pyarrow: None xarray: None IPython: 5.3.0 sphinx: 1.6.3 patsy: 0.4.1 dateutil: 2.6.1 pytz: 2017.3 blosc: None bottleneck: 1.2.1 tables: 3.4.2 numexpr: 2.6.2 feather: None matplotlib: 2.0.0 openpyxl: 2.5.0a2 xlrd: 1.0.0 xlwt: 1.2.0 xlsxwriter: 0.9.8 lxml: 3.8.0 bs4: 4.6.0 html5lib: 0.9999999 sqlalchemy: 1.1.13 pymysql: 0.7.9.None psycopg2: None jinja2: 2.9.6 s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: 0.4.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Strateuscommented, Nov 25, 2017

I have same issue. How to reproduce:

import pandas as pd
from IPython.display import display
df = pd.DataFrame(
    pd.np.random.random((10000000, 1)), 
    columns=['a'], 
    index=pd.date_range(start='2001-01-01', freq='min', periods=10000000)
)
display(df.a)

if you just run display(df) - it works well.

0reactions
JoshuaC3commented, Jun 13, 2018

I no longer get this issue. I have updated a lot of things a lot of times so couldn’t pin it to any one thing. Thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter notebook is slow/laggy, even with refreshed kernel ...
Try out same Jupyter Notebook using smaller datasets. · Try out the same Python code using command line instead of from within Jupyter...
Read more >
Cripplingly slow UI: am I the only one? - JupyterLab
It seems like any change in a visible element (typing in a notebook cell or scrolling a notebook) somehow has to cascade through...
Read more >
Jupyter Notebook code editor slow to the point of zero ...
The issue was primarily related to the split-screen preview implementation which was replaced with convenient Jupyter notebook view in in PyCharm 2021.3 EAP...
Read more >
Jupyter notebook running very slow
So to answer your question the issue is not with your machine or your Jupyter Notebook. Rather it is with how many iterations...
Read more >
Boosting Your Jupyter Notebook Productivity | by Nazif Berat
Plotting in notebooks · matplotlib (de-facto standard), activated with %matplotlib inline · %matplotlib notebook is interactive regime, but very slow, since ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found