2
$\begingroup$

Consider the following minimalist Dataset:

Query[All,All]@<|
    1-><|1->"data11",2->"data12"|>,
    2-><|1->"data21",2->"data22"|>
|>//Dataset

Its columns names 1 and 2 are not strings so the Dataset doesn't display them as columns but rather as nested rows. If i turn them into strings they display properly.

Query[All,KeyMap[ToString]]@<|
    1-><|1->"data11",2->"data12"|>,
    2-><|1->"data21",2->"data22"|>
|>//Dataset

But the problem I am facing is that my dataset has a lot of columns with large string names. So I want to rotate their names so they display within my screen.

Query[All,KeyMap[Rotate["very large named column "<>ToString@#,90\[Degree]]&]]@<|
    1-><|1->"data11",2->"data12"|>,
    2-><|1->"data21",2->"data22"|>
|>//Dataset

Is there a way to get it to display as a column rather than nested rows?

After rotating or restyling the string to reduce its font size changes its type so the StringQ returns False.

Are there native string operations available in Wolfram language which after transformation returns a String rather than some other expression.

$\endgroup$
  • 1
    $\begingroup$ Query[All,KeyMap[ToString[Rotate["very large named column "<>ToString@#,90\[Degree]], StandardForm]&]] ? (Need to figure out how to display the whole label.) $\endgroup$ – kglr Aug 6 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.