Skip to content

Commit

Permalink
feat:GridTableForm can be invoked on datasets.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Dec 10, 2021
1 parent e4e1d05 commit 6371c93
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions MathematicaForPredictionUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,18 @@ Mathematica is (C) Copyright 1988-2016 Wolfram Research, Inc.
]
];

GridTableForm[ds_Dataset] :=
Which[
AssociationQ[Normal[ds]] && AssociationQ[Normal[ds][[1]]],
GridTableForm[Normal@ds[Values, Values], TableHeadings -> Normal[Keys[ds[[1]]]]],

ListQ[Normal[ds]] && AssociationQ[Normal[ds][[1]]],
GridTableForm[Normal@ds[Values], TableHeadings -> Normal[Keys[ds[[1]]]]],

True,
GridTableForm[Normal@ds]
];

GridTableForm[___] :=
Block[{},
Message[GridTableForm::nargs];
Expand Down

0 comments on commit 6371c93

Please sign in to comment.