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

[BUG] IndexError: index 0 is out of bounds for axis 0 with size 0 #481

Open
lzmax888 opened this issue Jun 10, 2022 · 0 comments
Open

[BUG] IndexError: index 0 is out of bounds for axis 0 with size 0 #481

lzmax888 opened this issue Jun 10, 2022 · 0 comments

Comments

@lzmax888
Copy link

%matplotlib inline
from IPython.display import display
import numpy as np

import pandas as pd
import lux

autos = pd.read_csv('http://github.com/mattharrison/datasets/raw/master/data/vehicles.csv.zip')
autos.intent = ['combinedUF','cityUF']
autos

                  • OUTPUT - - - - - - - -

/home/max/anaconda3/lib/python3.9/site-packages/IPython/core/formatters.py:918: UserWarning:
Unexpected error in rendering Lux widget and recommendations. Falling back to Pandas display.
Please report the following issue on Github: https://github.com/lux-org/lux/issues

/home/max/anaconda3/lib/python3.9/site-packages/lux/core/frame.py:632: UserWarning:Traceback (most recent call last):
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/core/frame.py", line 594, in ipython_display
self.maintain_recs()
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/core/frame.py", line 436, in maintain_recs
custom_action_collection = custom_actions(rec_df)
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/action/custom.py", line 76, in custom_actions
recommendation = lux.config.actions[action_name].action(ldf)
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/action/enhance.py", line 65, in enhance
vlist = lux.vis.VisList.VisList(intent, ldf)
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/vis/VisList.py", line 43, in init
self.refresh_source(self._source)
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/vis/VisList.py", line 336, in refresh_source
lux.config.executor.execute(self._collection, ldf, approx=approx)
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/executor/PandasExecutor.py", line 147, in execute
PandasExecutor.execute_2D_binning(vis)
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/executor/PandasExecutor.py", line 422, in execute_2D_binning
result = groups.agg(
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/core/groupby.py", line 32, in aggregate
ret_val = super(LuxGroupBy, self).aggregate(*args, **kwargs)
File "/home/max/anaconda3/lib/python3.9/site-packages/pandas/core/groupby/generic.py", line 271, in aggregate
ret = self._aggregate_multiple_funcs(func)
File "/home/max/anaconda3/lib/python3.9/site-packages/pandas/core/groupby/generic.py", line 326, in _aggregate_multiple_funcs
results[key] = self.aggregate(func)
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/core/groupby.py", line 32, in aggregate
ret_val = super(LuxGroupBy, self).aggregate(*args, **kwargs)
File "/home/max/anaconda3/lib/python3.9/site-packages/pandas/core/groupby/generic.py", line 284, in aggregate
return self._python_agg_general(func, *args, **kwargs)
File "/home/max/anaconda3/lib/python3.9/site-packages/pandas/core/groupby/groupby.py", line 1481, in _python_agg_general
result = self.grouper.agg_series(obj, f)
File "/home/max/anaconda3/lib/python3.9/site-packages/pandas/core/groupby/ops.py", line 981, in agg_series
result = self._aggregate_series_pure_python(obj, func)
File "/home/max/anaconda3/lib/python3.9/site-packages/pandas/core/groupby/ops.py", line 1005, in _aggregate_series_pure_python
res = func(group)
File "/home/max/anaconda3/lib/python3.9/site-packages/pandas/core/groupby/groupby.py", line 1467, in
f = lambda x: func(x, *args, **kwargs)
File "/home/max/anaconda3/lib/python3.9/site-packages/lux/executor/PandasExecutor.py", line 423, in
[("count", "count"),(color_attr.attribute, lambda x: pd.Series.mode(x).iat[0]),]).reset_index()
File "/home/max/anaconda3/lib/python3.9/site-packages/pandas/core/indexing.py", line 2221, in getitem
return self.obj._get_value(*key, takeable=self._takeable)
File "/home/max/anaconda3/lib/python3.9/site-packages/pandas/core/series.py", line 1066, in _get_value
return self._values[label]
IndexError: index 0 is out of bounds for axis 0 with size 0

Package Versions

           Version
    python  3.9.7 
       lux  0.5.1 
    pandas  1.4.2 
 luxwidget 0.1.11 
matplotlib  3.4.3 
    altair  4.2.0 
   IPython 7.29.0 
 ipykernel  6.4.1 
ipywidgets  7.6.5 

jupyter_client 6.1.12
jupyter_core 4.8.1
jupyter_server 1.4.1
jupyterlab 3.2.1
nbclient 0.5.3
nbconvert 6.1.0
nbformat 5.1.3
notebook 6.4.5
qtconsole 5.1.1
traitlets 5.1.0

Widget Setup

✅ Jupyter Notebook Running
✅ luxwidget is enabled

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

No branches or pull requests

1 participant