I have a dataset with normal numbers (either integers or real) and I would like to visualize the dataset in a table where, for every row a colormap shows the ranking of the numbers from Min (blue) to Max (red) but I cannot find an option to do that.
For example like this:
myDataset = Dataset[{<|"a" -> 5, "b" -> 7, "c" -> 2|>,
<|"a" -> 3.3, "b" -> 5.1, "c" -> 9.7|>}]
I came across something that includes this code here from this example, but I don't find a way to apply it to my datset
primarydiffs=primarywardvotes[All,<|"TJ-CS"->#["TISHAURA JONES"]-#["CARA SPENCER"],"TJ-LR"->#["TISHAURA JONES"]-#["LEWIS REED"],\[IndentingNewLine]"CS-LR"->#["CARA SPENCER"]-#["LEWIS REED"]\[IndentingNewLine]|>&]
wdmax=primarydiffs[Max];wdmin=primarydiffs[Min];
addBG=Dataset[#,Background->{(ColorData["TemperatureMap"][(#1-wdmin)/(wdmax-wdmin)]&)}]&;
The datasets that I want to apply it to are either ALL integers or ALL real numbers, not mixed as my example up.
Appreciate your help!
Edit:
And how would I do that if I would not the last two columns do be included in that? So only columns 2-8 should be "temperaturemapped", i.e. [All, 2;;8]. And again, the temperaturemap only per row, not vertically.
Edit2: Here is a bigger example dataset, I already included a proposed code from @Syed. So the first column should be ignored (is not part of the calculation, just a district number, and the last 2 also should not be included. Or get their own temperaturemap, but they would need it vertically in the column, i.e. across districts. Is that possible? Otherwise I am fine if it is per district (=row) for Party 1 to Party 7.
myDataset2 =
Dataset[{<|"District No." -> 1,
"Party 1" -> RandomInteger[10000; 100000],
"Party 2" -> RandomInteger[10000; 100000],
"Party 3" -> RandomInteger[10000; 100000],
"Party 4" -> RandomInteger[10000; 100000],
"Party 5" -> RandomInteger[10000; 100000],
"Party 6" -> RandomInteger[10000; 100000],
"Party 7" -> RandomInteger[10000; 100000],
"Invalid" -> RandomInteger[10000; 100000],
"Absent" -> RandomInteger[10000; 100000]|>,
<|"District No." -> 2, "Party 1" -> RandomInteger[10000; 100000],
"Party 2" -> RandomInteger[10000; 100000],
"Party 3" -> RandomInteger[10000; 100000],
"Party 4" -> RandomInteger[10000; 100000],
"Party 5" -> RandomInteger[10000; 100000],
"Party 6" -> RandomInteger[10000; 100000],
"Party 7" -> RandomInteger[10000; 100000],
"Invalid" -> RandomInteger[10000; 100000],
"Absent" -> RandomInteger[10000; 100000]|>,
<|"District No." -> 3, "Party 1" -> RandomInteger[10000; 100000],
"Party 2" -> RandomInteger[10000; 100000],
"Party 3" -> RandomInteger[10000; 100000],
"Party 4" -> RandomInteger[10000; 100000],
"Party 5" -> RandomInteger[10000; 100000],
"Party 6" -> RandomInteger[10000; 100000],
"Party 7" -> RandomInteger[10000; 100000],
"Invalid" -> RandomInteger[10000; 100000],
"Absent" -> RandomInteger[10000; 100000]|>,
<|"District No." -> 4, "Party 1" -> RandomInteger[10000; 100000],
"Party 2" -> RandomInteger[10000; 100000],
"Party 3" -> RandomInteger[10000; 100000],
"Party 4" -> RandomInteger[10000; 100000],
"Party 5" -> RandomInteger[10000; 100000],
"Party 6" -> RandomInteger[10000; 100000],
"Party 7" -> RandomInteger[10000; 100000],
"Invalid" -> RandomInteger[10000; 100000],
"Absent" -> RandomInteger[10000; 100000]|>,
<|"District No." -> 5, "Party 1" -> RandomInteger[10000; 100000],
"Party 2" -> RandomInteger[10000; 100000],
"Party 3" -> RandomInteger[10000; 100000],
"Party 4" -> RandomInteger[10000; 100000],
"Party 5" -> RandomInteger[10000; 100000],
"Party 6" -> RandomInteger[10000; 100000],
"Party 7" -> RandomInteger[10000; 100000],
"Invalid" -> RandomInteger[10000; 100000],
"Absent" -> RandomInteger[10000; 100000]|>
}, Background -> {(ColorData["LightTemperatureMap"][
Rescale[#, MinMax[myDataset2]]] &)}]
10000;
? $\endgroup$