Skip to content

Commit

Permalink
Handled scalar values in dynamic Dataset.groupby
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jun 4, 2016
1 parent c4fd856 commit 266480d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion holoviews/core/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,11 @@ def groupby(self, dimensions=[], container_type=HoloMap, group_type=None,
group_dims = [d.name for d in self.kdims if d not in dimensions]
def load_subset(*args):
constraint = dict(zip(dim_names, args))
return group_type(self.select(**constraint).reindex(group_dims))
group = self.select(**constraint)
if np.isscalar(group):
return group_type(([group],), group=self.group,
label=self.label, vdims=self.vdims)
return group_type(group).reindex(group_dims)
dynamic_dims = [d(values=list(self.interface.values(self, d.name, False)))
for d in dimensions]
return DynamicMap(load_subset, kdims=dynamic_dims)
Expand Down

0 comments on commit 266480d

Please sign in to comment.