Posterior plot errors with boolean array
See original GitHub issueWhen passed a boolean array, plot_posterior
fails with the following error because np.histogram
assumes that subtraction is defined on the array:
TypeError('numpy boolean subtract, the `-` operator, is not supported, use the bitwise_xor, the `^` operator, or the logical_xor function instead.')
This example reproduces the error:
import numpy as np
import arviz as az
data = np.random.choice(a=[False, True], size=(4, 100))
az.plot_posterior(data)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Bug or meant to be: numpy raises "ValueError: too many ...
When you use that to index t , you pull out only the elements where the boolean array is True leaving you with...
Read more >bayesplot: Plotting for Bayesian Models
Description Plotting functions for posterior analysis, MCMC diagnostics, prior and posterior predictive checks, and other visualizations.
Read more >Bayesian Boolean Matrix Factorisation
Boolean matrix factorisation aims to decompose a binary data matrix into an approximate Boolean product of two low rank, binary matrices: one.
Read more >PPC-distributions • bayesplot - Stan
A boolean defining whether to plot the difference between the observed ECDF and the theoretical expectation for uniform PIT values rather than plotting...
Read more >lenstronomy.Plots package - Read the Docs
plots a lens model (convergence) and the critical curves and caustics ... error_map – 2d numpy array of size of the image, additional...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We should use bar graph with counts for bool data, not hist.
I’d expect the second, even though the first option is easier.