df.interactive() fails on a pandas DataFrame that has 'interface' in df.columns
See original GitHub issueALL software version info
- holoviz_tutorial (see: https://pyviz-dev.github.io/holoviz/tutorial/Setup.html) on Windows 10
Description of expected behavior and the observed behavior
Expected: executing interactive()
on a pandas.DataFrame
should return an interactive pandas DataFrame that I can use with widgets. This should be true for any column name specified in the DataFrame
.
Observed: interactive()
fails on a pandas.DataFrame
object that includes a column named interface
.
Complete, minimal, self-contained example code that reproduces the issue
import hvplot.pandas
pd.DataFrame([1,2,3], columns=['interface']).interactive()
Stack traceback and/or browser JavaScript console output
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-11-dff52aeb506d> in <module>
1 import hvplot.pandas
----> 2 pd.DataFrame([1,2,3], columns=['interface']).interactive()
~\Projects\holoviz_tutorial\envs\default\lib\site-packages\hvplot\pandas.py in <lambda>(self)
17 setattr(pd.Series, name, plot_prop)
18
---> 19 _patch_interactive = lambda self: Interactive(self)
20 _patch_interactive.__doc__ = Interactive.__call__.__doc__
21 interactive_prop = property(_patch_interactive)
~\Projects\holoviz_tutorial\envs\default\lib\site-packages\hvplot\interactive.py in __init__(self, obj, transform, plot, depth, loc, center, dmap, inherit_kwargs, max_rows, **kwargs)
83 self._max_rows = max_rows
84 self._kwargs = kwargs
---> 85 ds = hv.Dataset(self._obj)
86 self._current = self._transform.apply(ds, keep_index=True, compute=False)
87 self._init = True
~\Projects\holoviz_tutorial\envs\default\lib\site-packages\holoviews\core\data\__init__.py in __init__(self, data, kdims, vdims, **kwargs)
339
340 validate_vdims = kwargs.pop('_validate_vdims', True)
--> 341 initialized = Interface.initialize(type(self), data, kdims, vdims,
342 datatype=kwargs.get('datatype'))
343 (data, self.interface, dims, extra_kws) = initialized
~\Projects\holoviz_tutorial\envs\default\lib\site-packages\holoviews\core\data\interface.py in initialize(cls, eltype, data, kdims, vdims, datatype)
206
207 # Process Element data
--> 208 if (hasattr(data, 'interface') and issubclass(data.interface, Interface)):
209 if datatype is None:
210 datatype = [dt for dt in data.datatype if dt in eltype.datatype]
TypeError: issubclass() arg 1 must be a class
Screenshots or screencasts of the bug in action
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Python / Pandas - GUI for viewing a DataFrame or Matrix
Basically a window that has a read-only spreadsheet like view into the data. I can expand columns, page up and down through long...
Read more >Using PandasGUI to analyze Pandas DataFrames on ...
This article shows how to use PandasGUI tool for basic data analysis with the simple GUI interface. The demo application uses Corona Virus ......
Read more >Python Pandas Select Columns Tutorial - DataCamp
Use Python Pandas and select columns from DataFrames. Follow our tutorial with code examples and learn different ways to select your data today!...
Read more >Solved: Dataframe output Key Error - Alteryx Community
Pandas KeyError occurs when we try to access some column/row label in our DataFrame that doesn't exist. Usually, this error occurs when you ......
Read more >Indexing and Selecting Data — pandas 0.13.1 documentation
You may access an index on a Series, column on a DataFrame, and a item on a ... In [12]: sa = Series([1,2,3],index=list('abc'))...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great! Please open a PR with those changes: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
I implemented a fix in
holoviews/core/data/interface
and also added a test that succeeds only after the fix. However, I do not have access rights to push the createdfix-core-data-interface
branch to holoviews. How can I push the fix to origin?