Ordering of variables after coords set
See original GitHub issueShort Description
I’m trying to use the coords/dims to set labels on posterior variables from a stan fit and the order of the dimensions gets shuffled when I set the labels (not sure what determines the order). Is there a way to (1) retain the existing order (A,B,C…) and (2) sort the order according to a custom index that I provide (e.g. pass a index array like [2,1,0,3, …] to have the plot appear in the order [C, B, A, D …])?
Sorry if this is covered in the documentation somewhere, I didn’t see it.
Without setting any coords/dims, the variables appear in the same order as one would expect from the stan code.
Setting the coords/dims with the code below changes the order to this.
Code Example or link
azdata = az.from_pystan(posterior=fit, observed_data=['Y'], coords={'betas': ['A', 'B', 'C', 'D', 'E', 'F', 'G']}, dims={'b': ['betas']})
axes = az.plot_forest(azdata, var_names=('b'))
Using arviz 0.3.2
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Coordinate system and ordered pairs - Math Planet
An ordered pair contains the coordinates of one point in the coordinate system. A point is named by its ordered pair of the...
Read more >The Cartesian Coordinate System
Ordered Pair, A set of two numbers, with the x-coordinate (independent variable) listed first, and the y-coordinate (dependent variable) listed second.
Read more >Linear Equations in Two Variables - Plotting Ordered Pairs
In this video, we learn about linear equations in two variables. ... cover the Cartesian Coordinate System and how to plot ordered pairs....
Read more >1.3 – Coordinate Plane and Graphing Equations
(1.3.2) – Create a table of ordered pairs from a two-variable linear equation and graph. A linear relationship is a relationship between variables...
Read more >Linear Equations in Two Variables Lesson - GreeneMath.com
This plane allows us to plot ordered pairs and graph linear equations in two variables. The name for the Cartesian Coordinate System may...
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 Free
Top 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
fixed by #557
There was a set making things out-of-order
ps. I recommend
az.to_netcdf
andaz.from_netcdf
for file sharing.Thanks for the prompt reply @daeh! (also, kudos for the sweet
pathlib
use!)This can be recreated with the eight schools model in pymc3. I should be able to dig deeper tomorrow morning. Definitely a bug, but thank goodness that the dimensions map correctly (0 -> ‘a’, 1 -> ‘b’, etc)!