V 12.1 on windows.
I use Associations allot as input for my dsolve
solver I am writing. I do not use Dataset
, other than to format the list of ODE's I am testing on in a nice way.
I noticed Dataset
displays things differently based on order of associations in the list. Since some associations have more keys than others (some has initial conditions for example, some do not), I'd like the display to always shows the key names as header at top. Here is a MWE to explain
ClearAll[x,y];
ode1 = <|"ode" -> y'[x] + y'[x]^2 == x, "y" -> y, "x" -> x, "ic" -> 1 == y[0]|>;
ode2 = <|"ode" -> y'[x] + x - Sin[x] == 0, "y" -> z, "x" -> x|>;
ode3 = <|"ode" -> y'[x]^2 + x - Sin[x] == 0, "y" -> y, "x" -> x|>;
Dataset[{ode1, ode2, ode3}]
But what I want is the following, where now ode2
is first one in list, the one which has less keys than the first one.
Dataset[{ode2, ode1, ode3}]
Is this how it supposed to work by design? If there a way to tell Dataset
to always format its output as in the second case above regardless of order of associations in list? I looked at help, but not seeing something obvious so far. May be I need to use HeaderDisplayFunction
? (new in V 12.1)