0
$\begingroup$

This is my current Dataset:

list={<|"nTk"->"6T6","Order"->24,"Attributes"->{},"Name"->"A4*C2","PermutationGroupRepresentation"->PermutationGroup[{Cycles[{{3,6}}],Cycles[{{1,3,5},{2,4,6}}]}],"Generators"->{Cycles[{{3,6}}],Cycles[{{1,3,5},{2,4,6}}]},"CycleTypes"->{{},{2},{6},{2,2},{3,3},{2,2,2}}|>,<|"nTk"->"6T7","Order"->24,"Attributes"->{"InAn"},"Name"->"S4(a)","PermutationGroupRepresentation"->PermutationGroup[{Cycles[{{1,4},{2,5}}],Cycles[{{1,3,5},{2,4,6}}],Cycles[{{1,5},{2,4}}]}],"Generators"->{Cycles[{{1,4},{2,5}}],Cycles[{{1,3,5},{2,4,6}}],Cycles[{{1,5},{2,4}}]},"CycleTypes"->{{},{2,2},{2,4},{3,3}}|>,<|"nTk"->"6T8","Order"->24,"Attributes"->{},"Name"->"S4(b)","PermutationGroupRepresentation"->PermutationGroup[{Cycles[{{1,4},{2,5}}],Cycles[{{1,3,5},{2,4,6}}],Cycles[{{1,5},{2,4},{3,6}}]}],"Generators"->{Cycles[{{1,4},{2,5}}],Cycles[{{1,3,5},{2,4,6}}],Cycles[{{1,5},{2,4},{3,6}}]},"CycleTypes"->{{},{4},{2,2},{3,3},{2,2,2}}|>,<|"nTk"->"6T9","Order"->36,"Attributes"->{},"Name"->"S3*S3","PermutationGroupRepresentation"->PermutationGroup[{Cycles[{{2,4,6}}],Cycles[{{1,5},{2,4}}],Cycles[{{1,4},{2,5},{3,6}}]}],"Generators"->{Cycles[{{2,4,6}}],Cycles[{{1,5},{2,4}}],Cycles[{{1,4},{2,5},{3,6}}]},"CycleTypes"->{{},{3},{6},{2,2},{3,3},{2,2,2}}|>,<|"nTk"->"6T10","Order"->36,"Attributes"->{"InAn"},"Name"->"F36","PermutationGroupRepresentation"->PermutationGroup[{Cycles[{{2,4,6}}],Cycles[{{1,5},{2,4}}],Cycles[{{1,4,5,2},{3,6}}]}],"Generators"->{Cycles[{{2,4,6}}],Cycles[{{1,5},{2,4}}],Cycles[{{1,4,5,2},{3,6}}]},"CycleTypes"->{{},{3},{2,2},{2,4},{3,3}}|>};
ds=Dataset[list]

enter image description here

Currently, the first row of my table is very wide because of the "CycleTypes" field, since it is a list structure. Only one element is shown in the first row, but it stretches every row to be wide. Of course, I know that using something like:

ds[All, {"CycleTypes" -> (Row[#, ","] &)}]

enter image description here

can make the contents of the "CycleTypes" field display horizontally, which is indeed the style I want. However, the problem is that (Row[#, ","] &) breaks the actual content of this field, making those lists unusable for subsequent computations, so I don’t want to use this solution.

In other words, I don’t want to change the content of the Dataset; I only want the "CycleTypes" field to display horizontally instead of vertically. I suspect that ItemDisplayFunction could achieve this, but after trying for quite a while, I still don’t know how to implement it.

$\endgroup$
4
  • $\begingroup$ It seems that ItemDisplayFunction decides that the deepest level of the dataset, even when "CycleTypes" is specified as the position is the non-empty lists and completely ignores the empty list. Item clearly only specifies this deepest level. You might be able to fight the type system identification with the Dataset`* functions or you can wrap "CycleTypes" in a finiteGroupCycleTypes head that won't be unwrapped. Then "CycleTypes" -> (Row[#[[1]], ","] &) works just fine. This has the side effect being semantically more clear as you write functions to act on this data $\endgroup$ Commented Sep 25 at 15:09
  • $\begingroup$ Although ds[...] returns a changed data file, ds itself is not changed and can be used for further work. $\endgroup$ Commented Sep 25 at 17:54
  • $\begingroup$ @DanielHuber I am currently writing a function. The user can only see the final output, which is ds[All, {"CycleTypes" -> (Row[#, ","] &)}]. The original ds is not accessible to the user. $\endgroup$ Commented Sep 26 at 18:25
  • $\begingroup$ You could return both. $\endgroup$ Commented Sep 27 at 7:19

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.