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

Datasets with one value break freedmanDiaconis and scott methods #42

Open
hughess opened this issue Nov 16, 2021 · 1 comment
Open

Datasets with one value break freedmanDiaconis and scott methods #42

hughess opened this issue Nov 16, 2021 · 1 comment

Comments

@hughess
Copy link

hughess commented Nov 16, 2021

Occasionally, I need to show a histogram that contains only one value (the dataset below is an example):

[
{a: 5},
{a: 5},
{a: 5},
{a: 5},
{a: 5},
{a: 5},
{a: 5}
]

This works with the default bin method (square root) and works with sturges, but does not work with freedmanDiaconis or scott. For the two methods where it does not work, I receive an "Invalid array length" error.

While the chart itself isn't meaningful when it only has 1 value, it is a use case that will come up occasionally.

@pomelo-alias
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants