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

Added a groupby argument to the histogram operation #1725

Merged
merged 2 commits into from Jul 15, 2017
Merged

Conversation

@philippjfr
Copy link
Member

@philippjfr philippjfr commented Jul 14, 2017

As suggested in #1716 we should have an easier way to generate a grouped/faceted histogram. The current approach is as follows:

hv.Dataset(autompg).groupby('cyl').hist(dimension='mpg', adjoin=False).overlay()

For simplicities sake I suggest adding this:

hv.Dataset(autompg).hist(dimension='mpg', groupby='cyl', adjoin=False)

OR

histogram(hv.Dataset(autompg), dimension='mpg', groupby='cyl')

bokeh_plot 90

Going to add gallery demos before this is ready to merge.

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Jul 14, 2017

Is a nice exception raised if you try to groupby dimensions that are not available/make no sense?

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Jul 14, 2017

Just the usual exception raised when a dimension is not found:

KeyError: u'Dimension cylinder not found'

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Jul 14, 2017

Maybe groupby should be explicitly listed as an argument of .hist so you can see this argument exists when inspecting the signature (instead of just seeing **kwargs).

@philippjfr
Copy link
Member Author

@philippjfr philippjfr commented Jul 15, 2017

Let's merge this now, you've already opened an issue to make the .hist signatures more consistent.

@jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Jul 15, 2017

Sounds good.

@jlstevens jlstevens merged commit aff5715 into master Jul 15, 2017
4 checks passed
4 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.02%) to 79.614%
Details
@philippjfr
s3-reference-data-cache Test data is cached.
Details
@philippjfr philippjfr deleted the hist_groupby branch Jul 31, 2017
@jlstevens jlstevens added this to the 1.8.2 milestone Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants