Skip to content
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

IndexError: list index out of range in sequence.py:77 when using jupyterlab #363

Closed
timhughes opened this issue Feb 3, 2020 · 6 comments
Labels
bug 🐛 Something isn't working

Comments

@timhughes
Copy link

timhughes commented Feb 3, 2020

Index error when using jupyterlab

~/tmp/sample/venv/lib64/python3.7/site-packages/pandas_profiling/report/presentation/flavours/widget/sequence.py in render(self)
     75         elif self.sequence_type == "variable":
     76             i1 = self.content["items"][0].render()
---> 77             i2 = self.content["items"][1].render()
     78             toggle = widgets.ToggleButton(description="Toggle details")
     79 

IndexError: list index out of range

Click to expand Full Traceback


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
~/tmp/sample/venv/lib64/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj)
    343             method = get_real_method(obj, self.print_method)
    344             if method is not None:
--> 345                 return method()
    346             return None
    347         else:

~/tmp/sample/venv/lib64/python3.7/site-packages/pandas_profiling/__init__.py in _repr_html_(self)
    222     def _repr_html_(self):
    223         """The ipython notebook widgets user interface gets called by the jupyter notebook."""
--> 224         self.to_widgets()
    225 
    226     def __repr__(self):

~/tmp/sample/venv/lib64/python3.7/site-packages/pandas_profiling/__init__.py in to_widgets(self)
    210         from IPython.core.display import display, HTML
    211 
--> 212         report = WidgetReport(self.report).render()
    213 
    214         display(report)

~/tmp/sample/venv/lib64/python3.7/site-packages/pandas_profiling/report/presentation/flavours/widget/sequence.py in render(self)
     95 
     96         elif self.sequence_type in ["tabs", "sections"]:
---> 97             widget = get_tabs(self.content["items"])
     98         elif self.sequence_type == "accordion":
     99             widget = get_accordion(self.content["items"])

~/tmp/sample/venv/lib64/python3.7/site-packages/pandas_profiling/report/presentation/flavours/widget/sequence.py in get_tabs(items)
     16     titles = []
     17     for item in items:
---> 18         children.append(item.render())
     19         titles.append(get_name(item))
     20 

~/tmp/sample/venv/lib64/python3.7/site-packages/pandas_profiling/report/presentation/flavours/widget/sequence.py in render(self)
     97             widget = get_tabs(self.content["items"])
     98         elif self.sequence_type == "accordion":
---> 99             widget = get_accordion(self.content["items"])
    100         elif self.sequence_type == "grid":
    101             widget = get_row(self.content["items"])

~/tmp/sample/venv/lib64/python3.7/site-packages/pandas_profiling/report/presentation/flavours/widget/sequence.py in get_accordion(items)
     59     titles = []
     60     for item in items:
---> 61         children.append(item.render())
     62         titles.append(get_name(item))
     63 

~/tmp/sample/venv/lib64/python3.7/site-packages/pandas_profiling/report/presentation/flavours/widget/preview.py in render(self)
      9         else:
     10             items = [self.content["top"]]
---> 11         return WidgetSequence(items, sequence_type="variable").render()

~/tmp/sample/venv/lib64/python3.7/site-packages/pandas_profiling/report/presentation/flavours/widget/sequence.py in render(self)
     75         elif self.sequence_type == "variable":
     76             i1 = self.content["items"][0].render()
---> 77             i2 = self.content["items"][1].render()
     78             toggle = widgets.ToggleButton(description="Toggle details")
     79 

IndexError: list index out of range

To Reproduce

Data:

Code:

"""
Test for issue #363:
https://github.com/pandas-profiling/pandas-profiling/issues/363
"""
import pandas as pd
from pandas_profiling import ProfileReport

df = pd.read_csv('https://gist.githubusercontent.com/timhughes/49ff704f617b086ccf61c90ab4a773e9/raw/b7d93a27617249d8403fdaf6077f9a60fdf4ff5e/sample.csv')


profile = ProfileReport(df, title='Pandas Profiling Report', html={'style':{'full_width':True}})
profile

Version information:

  • Python version: 3.7.6
  • Environment: jupyterlab
  • pip:
Click to expand Version information

astroid==2.3.3
astropy==4.0
attrs==19.3.0
backcall==0.1.0
bleach==3.1.0
confuse==1.0.0
cycler==0.10.0
decorator==4.4.1
defusedxml==0.6.0
entrypoints==0.3
htmlmin==0.1.12
importlib-metadata==1.5.0
ipykernel==5.1.4
ipython==7.12.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
isort==4.3.21
jedi==0.16.0
Jinja2==2.11.1
joblib==0.14.1
json5==0.9.0
jsonschema==3.2.0
jupyter-client==5.3.4
jupyter-core==4.6.1
jupyterlab==1.2.6
jupyterlab-server==1.0.6
kiwisolver==1.1.0
lazy-object-proxy==1.4.3
llvmlite==0.31.0
MarkupSafe==1.1.1
matplotlib==3.1.3
mccabe==0.6.1
missingno==0.4.2
mistune==0.8.4
more-itertools==8.2.0
nbconvert==5.6.1
nbformat==5.0.4
notebook==6.0.3
numba==0.48.0
numpy==1.18.1
packaging==20.1
pandas==1.0.0
pandas-profiling==2.4.0
pandocfilters==1.4.2
parso==0.6.0
pexpect==4.8.0
phik==0.9.9
pickleshare==0.7.5
pluggy==0.13.1
prometheus-client==0.7.1
prompt-toolkit==3.0.3
ptyprocess==0.6.0
py==1.8.1
Pygments==2.5.2
pylint==2.4.4
pyparsing==2.4.6
pyrsistent==0.15.7
pytest==5.3.5
pytest-pylint==0.14.1
python-dateutil==2.8.1
pytz==2019.3
PyYAML==5.3
pyzmq==18.1.1
scipy==1.4.1
seaborn==0.10.0
Send2Trash==1.5.0
six==1.14.0
terminado==0.8.3
testpath==0.4.4
tornado==6.0.3
traitlets==4.3.3
typed-ast==1.4.1
wcwidth==0.1.8
webencodings==0.5.1
widgetsnbextension==3.5.1
wrapt==1.11.2
zipp==2.1.0

@timhughes timhughes added the bug 🐛 Something isn't working label Feb 3, 2020
@vrb3
Copy link

vrb3 commented Feb 3, 2020

I am getting the same error. let me know if you were able to find a solution

@fasahatq
Copy link

fasahatq commented Feb 4, 2020

labeled_df.profile_report()

IndexError Traceback (most recent call last)
~\AppData\Local\Continuum\miniconda3\lib\site-packages\IPython\core\formatters.py in call(self, obj)
343 method = get_real_method(obj, self.print_method)
344 if method is not None:
--> 345 return method()
346 return None
347 else:

~\AppData\Local\Continuum\miniconda3\lib\site-packages\pandas_profiling_init_.py in repr_html(self)
222 def repr_html(self):
223 """The ipython notebook widgets user interface gets called by the jupyter notebook."""
--> 224 self.to_widgets()
225
226 def repr(self):

~\AppData\Local\Continuum\miniconda3\lib\site-packages\pandas_profiling_init_.py in to_widgets(self)
210 from IPython.core.display import display, HTML
211
--> 212 report = WidgetReport(self.report).render()
213
214 display(report)

~\AppData\Local\Continuum\miniconda3\lib\site-packages\pandas_profiling\report\presentation\flavours\widget\sequence.py in render(self)
95
96 elif self.sequence_type in ["tabs", "sections"]:
---> 97 widget = get_tabs(self.content["items"])
98 elif self.sequence_type == "accordion":
99 widget = get_accordion(self.content["items"])

~\AppData\Local\Continuum\miniconda3\lib\site-packages\pandas_profiling\report\presentation\flavours\widget\sequence.py in get_tabs(items)
16 titles = []
17 for item in items:
---> 18 children.append(item.render())
19 titles.append(get_name(item))
20

~\AppData\Local\Continuum\miniconda3\lib\site-packages\pandas_profiling\report\presentation\flavours\widget\sequence.py in render(self)
97 widget = get_tabs(self.content["items"])
98 elif self.sequence_type == "accordion":
---> 99 widget = get_accordion(self.content["items"])
100 elif self.sequence_type == "grid":
101 widget = get_row(self.content["items"])

~\AppData\Local\Continuum\miniconda3\lib\site-packages\pandas_profiling\report\presentation\flavours\widget\sequence.py in get_accordion(items)
59 titles = []
60 for item in items:
---> 61 children.append(item.render())
62 titles.append(get_name(item))
63

~\AppData\Local\Continuum\miniconda3\lib\site-packages\pandas_profiling\report\presentation\flavours\widget\preview.py in render(self)
9 else:
10 items = [self.content["top"]]
---> 11 return WidgetSequence(items, sequence_type="variable").render()

~\AppData\Local\Continuum\miniconda3\lib\site-packages\pandas_profiling\report\presentation\flavours\widget\sequence.py in render(self)
75 elif self.sequence_type == "variable":
76 i1 = self.content["items"][0].render()
---> 77 i2 = self.content["items"][1].render()
78 toggle = widgets.ToggleButton(description="Toggle details")
79

IndexError: list index out of range

@monical-cuelogic
Copy link

I am also getting the same error

@sbrugman
Copy link
Collaborator

sbrugman commented Feb 4, 2020

Seems like a pretty obstructive issue, I'll see if I can come with a solution and release soon.

Note that in the meantime you should be able to use profile.to_notebook_iframe()

@monical-cuelogic
Copy link

monical-cuelogic commented Feb 4, 2020 via email

@sbrugman sbrugman added this to the next release milestone Feb 6, 2020
sbrugman added a commit that referenced this issue Feb 14, 2020
- Progress bar added (#224)
- Character analysis for Text/NLP (#278)
- Themes: configuration and demo's (Orange, Dark)
- Tutorial on modifying the report's structure (#362; #281, #259, #253, #234). This jupyter notebook also demonstrates how to use the Kaggle api together with pandas-profiling.
- Toggle descriptions at correlations.

Deprecation:

- This is the last version to support Python 3.5.

Stability:

- The order of columns changed when sort="None" (#377, fixed).
- Pandas v1.0.X is not yet supported (#367, #366, #363, #353, pinned pandas to < 1)
- Improved mixed type detection (#351)
- Refactor of report structures.
- Correlations are more stable (e.g. Phi_k color scale now from 0-1, rows and columns with NaN values are dropped, #329).
- Distinct counts exclude NaNs.
- Fixed alerts in notebooks.

Other improvements:

- Warnings are now sorted.
- Links to Binder and Google Colab are added for notebooks (#349)
- The overview section is tabbed.
sbrugman added a commit that referenced this issue Feb 14, 2020
- Progress bar added (#224)
- Character analysis for Text/NLP (#278)
- Themes: configuration and demo's (Orange, Dark)
- Tutorial on modifying the report's structure (#362; #281, #259, #253, #234). This jupyter notebook also demonstrates how to use the Kaggle api together with pandas-profiling.
- Toggle descriptions at correlations.

Deprecation:

- This is the last version to support Python 3.5.

Stability:

- The order of columns changed when sort="None" (#377, fixed).
- Pandas v1.0.X is not yet supported (#367, #366, #363, #353, pinned pandas to < 1)
- Improved mixed type detection (#351)
- Refactor of report structures.
- Correlations are more stable (e.g. Phi_k color scale now from 0-1, rows and columns with NaN values are dropped, #329).
- Distinct counts exclude NaNs.
- Fixed alerts in notebooks.

Other improvements:

- Warnings are now sorted.
- Links to Binder and Google Colab are added for notebooks (#349)
- The overview section is tabbed.
sbrugman added a commit that referenced this issue Feb 14, 2020
- Progress bar added (#224)
- Character analysis for Text/NLP (#278)
- Themes: configuration and demo's (Orange, Dark)
- Tutorial on modifying the report's structure (#362; #281, #259, #253, #234). This jupyter notebook also demonstrates how to use the Kaggle api together with pandas-profiling.
- Toggle descriptions at correlations.

Deprecation:

- This is the last version to support Python 3.5.

Stability:

- The order of columns changed when sort="None" (#377, fixed).
- Pandas v1.0.X is not yet supported (#367, #366, #363, #353, pinned pandas to < 1)
- Improved mixed type detection (#351)
- Refactor of report structures.
- Correlations are more stable (e.g. Phi_k color scale now from 0-1, rows and columns with NaN values are dropped, #329).
- Distinct counts exclude NaNs.
- Fixed alerts in notebooks.

Other improvements:

- Warnings are now sorted.
- Links to Binder and Google Colab are added for notebooks (#349)
- The overview section is tabbed.

* Commit for pandas-profiling v2.5.0

- Progress bar added (#224)
- Character analysis for Text/NLP (#278)
- Themes: configuration and demo's (Orange, Dark)
- Tutorial on modifying the report's structure (#362; #281, #259, #253, #234). This jupyter notebook also demonstrates how to use the Kaggle api together with pandas-profiling.
- Toggle descriptions at correlations.

Deprecation:

- This is the last version to support Python 3.5.

Stability:

- The order of columns changed when sort="None" (#377, fixed).
- Pandas v1.0.X is not yet supported (#367, #366, #363, #353, pinned pandas to < 1)
- Improved mixed type detection (#351)
- Refactor of report structures.
- Correlations are more stable (e.g. Phi_k color scale now from 0-1, rows and columns with NaN values are dropped, #329).
- Distinct counts exclude NaNs.
- Fixed alerts in notebooks.

Other improvements:

- Warnings are now sorted.
- Links to Binder and Google Colab are added for notebooks (#349)
- The overview section is tabbed.
@elsieyin
Copy link

I also have the same issue, it seems the shape is ok,index is ok
index -9223372036854775808 is out of bounds for axis 0 with size 572736

chanedwin pushed a commit to chanedwin/pandas-profiling that referenced this issue Oct 11, 2020
- Progress bar added (ydataai#224)
- Character analysis for Text/NLP (ydataai#278)
- Themes: configuration and demo's (Orange, Dark)
- Tutorial on modifying the report's structure (ydataai#362; ydataai#281, ydataai#259, ydataai#253, ydataai#234). This jupyter notebook also demonstrates how to use the Kaggle api together with pandas-profiling.
- Toggle descriptions at correlations.

Deprecation:

- This is the last version to support Python 3.5.

Stability:

- The order of columns changed when sort="None" (ydataai#377, fixed).
- Pandas v1.0.X is not yet supported (ydataai#367, ydataai#366, ydataai#363, ydataai#353, pinned pandas to < 1)
- Improved mixed type detection (ydataai#351)
- Refactor of report structures.
- Correlations are more stable (e.g. Phi_k color scale now from 0-1, rows and columns with NaN values are dropped, ydataai#329).
- Distinct counts exclude NaNs.
- Fixed alerts in notebooks.

Other improvements:

- Warnings are now sorted.
- Links to Binder and Google Colab are added for notebooks (ydataai#349)
- The overview section is tabbed.

* Commit for pandas-profiling v2.5.0

- Progress bar added (ydataai#224)
- Character analysis for Text/NLP (ydataai#278)
- Themes: configuration and demo's (Orange, Dark)
- Tutorial on modifying the report's structure (ydataai#362; ydataai#281, ydataai#259, ydataai#253, ydataai#234). This jupyter notebook also demonstrates how to use the Kaggle api together with pandas-profiling.
- Toggle descriptions at correlations.

Deprecation:

- This is the last version to support Python 3.5.

Stability:

- The order of columns changed when sort="None" (ydataai#377, fixed).
- Pandas v1.0.X is not yet supported (ydataai#367, ydataai#366, ydataai#363, ydataai#353, pinned pandas to < 1)
- Improved mixed type detection (ydataai#351)
- Refactor of report structures.
- Correlations are more stable (e.g. Phi_k color scale now from 0-1, rows and columns with NaN values are dropped, ydataai#329).
- Distinct counts exclude NaNs.
- Fixed alerts in notebooks.

Other improvements:

- Warnings are now sorted.
- Links to Binder and Google Colab are added for notebooks (ydataai#349)
- The overview section is tabbed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants