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

Remove default group_label substitution with "Variable" #1271

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 2 additions & 4 deletions hvplot/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,10 +885,8 @@ def _process_data(self, kind, data, x, y, by, groupby, row, col,
'e.g. a NumPy array or xarray Dataset, '
f'found {type(self.data).__name__} type')

if hasattr(data, 'columns') and hasattr(data.columns, 'name') and data.columns.name and not group_label:
if hasattr(data, 'columns') and hasattr(data.columns, 'name') and data.columns.name and group_label is None:
group_label = data.columns.name
elif not group_label:
group_label = 'Variable'

if isinstance(data.columns, pd.MultiIndex) and x in (None, 'index') and y is None and not by:
self.data = data.stack().reset_index(1).rename(columns={'level_1': group_label})
Expand Down Expand Up @@ -944,7 +942,7 @@ def _process_data(self, kind, data, x, y, by, groupby, row, col,
self.gridded_data = gridded_data
self.use_dask = use_dask
self.indexes = indexes
self.group_label = group_label or 'Variable'
self.group_label = group_label
if isinstance(by, (np.ndarray, pd.Series)):
self.data = self.data.assign(_by=by)
self.by = ['_by']
Expand Down
Loading