Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions hvplot/plotting/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,19 @@ def _get_converter(self, x=None, y=None, kind=None, **kwds):

return HoloViewsConverter(data, x, y, kind=kind, **params)

def explorer(self, x=None, y=None, **kwds):
import polars as pl
from ..ui import explorer as ui_explorer

if isinstance(self._data, (pl.DataFrame, pl.Series)):
data = self._data.to_pandas()
elif isinstance(self._data, pl.LazyFrame):
data = self._data.collect().to_pandas()
else:
raise ValueError('Only Polars DataFrame, Series, and LazyFrame are supported')

return ui_explorer(data, x=x, y=y, **kwds)


class hvPlot(hvPlotTabular):
"""
Expand Down
4 changes: 3 additions & 1 deletion hvplot/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,9 @@ def ylim(self):
y = self._y
if not isinstance(y, list):
y = [y]
values = [ys for ys in (self._data[y] for y in y) if len(ys)]
values = [
ys for ys in (self._data[y] for y in y) if len(ys) and ys.dtype.kind not in 'OSU'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ys for ys in (self._data[y] for y in y) if len(ys) and ys.dtype.kind not in 'OSU'
ys for ys in (self._data[y] for y in y) if len(ys) and (hasattr(ys, 'dtype') and ys.dtype.kind not in 'OSU')

]
if not len(values):
return (np.nan, np.nan)
return max_range([(np.nanmin(vs), np.nanmax(vs)) for vs in values])