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

Error for histplot with weights and explicit bins as numpy array #3801

Open
kosiokarchev opened this issue Dec 13, 2024 · 0 comments
Open

Error for histplot with weights and explicit bins as numpy array #3801

kosiokarchev opened this issue Dec 13, 2024 · 0 comments

Comments

@kosiokarchev
Copy link

When I try to make a histplot with weights and explicitly provided bin edges as a numpy array, e.g.:

import numpy as np, seaborn as sns

sns.histplot(x=np.random.rand(100), weights=np.ones(100), bins=np.linspace(0, 1, 11))

I get the error

ValueError: The truth value of an array with more than one element is ambiguous. ...

It arises in this line:

and estimate_kws["bins"] == "auto"

and should be easily solvable by wrapping it in is True:

and (estimate_kws["bins"] == "auto") is True
@kosiokarchev kosiokarchev changed the title Error for histplot with weights and explicit bins Error for histplot with weights and explicit bins as numpy array Dec 13, 2024
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

1 participant