Skip to content

Commit

Permalink
Allow plotting anonymous pandas.Series
Browse files Browse the repository at this point in the history
If a Series has no name (empty string or None), uses a default "_" name
to avoid exceptions.

Fixes #4970
  • Loading branch information
DouglasRaillard committed Jul 14, 2021
1 parent 2cdb539 commit d738981
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion holoviews/core/data/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def init(cls, eltype, data, kdims, vdims):
kdim_param = element_params['kdims']
vdim_param = element_params['vdims']
if util.is_series(data):
data = data.to_frame()
name = data.name or '_'
data = data.to_frame(name=name)
if util.is_dataframe(data):
ncols = len(data.columns)
index_names = data.index.names if isinstance(data, pd.DataFrame) else [data.index.name]
Expand Down

0 comments on commit d738981

Please sign in to comment.