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

Qcut msg #9879

Closed
wants to merge 2 commits into from
Closed

Qcut msg #9879

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 13, 2015

closes #7751

Created a more informative error message.

@@ -186,7 +186,7 @@ def _bins_to_cuts(x, bins, right=True, labels=None, retbins=False,
ids = bins.searchsorted(x, side=side)

if len(algos.unique(bins)) < len(bins):
raise ValueError('Bin edges must be unique: %s' % repr(bins))
raise ValueError('The quantiles you selected do not result in unique bins. Try selecting fewer quantiles.')
Copy link
Member

Choose a reason for hiding this comment

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

This function is also called by the pd.cut function, for which this new message is not appropriate.

@cpcloud cpcloud added the Error Reporting Incorrect or improved errors from pandas label Apr 13, 2015
@cpcloud cpcloud added this to the 0.16.1 milestone Apr 13, 2015
@jreback jreback modified the milestones: 0.16.1, 0.17.0 Apr 17, 2015
@jreback
Copy link
Contributor

jreback commented May 9, 2015

closing, if/when updated pls reopen

@jreback jreback closed this May 9, 2015
@jorisvandenbossche jorisvandenbossche modified the milestones: 0.17.0, 0.16.2, No action Jun 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

qcut() should make sure the bins bounderies are unique before passing them to _bins_to_cuts
4 participants