Another way, if you start with raw numbers:
list = {{195, 2.3}, {198, 6.4}, {204, -3.1}}
Note that both Thread[{"x", "y"} -> {195, 2.3}]
and Thread[{"x", "y"} -> #] &[{195, 2.3}]
return
{"x" -> 195, "y" -> 2.3}
Map
the pure function Thread[{"x", "y"}->#]&
on every sub-list:
Map[Thread[{"x", "y"} -> #] &, list]
(*{{"x" -> 195, "y" -> 2.3}, {"x" -> 198, "y" -> 6.4}, {"x" -> 204, "y" -> -3.1}}*)
and replace the head of each sub-list with that of Association:
Apply[Association, Map[Thread[{"x", "y"} -> #] &, list], {1}]
(*or*)
Association @@@ Map[Thread[{"x", "y"} -> #] &, list]
(* {<|"x" -> 195, "y" -> 2.3|>, <|"x" -> 198, "y" -> 6.4|>, <|"x" -> 204, "y" -> -3.1|>} *)
Only thing left is to make this a Dataset
:
Dataset[%]
Written as a single instruction:
Association @@@ Map[Thread[{"x", "y"} -> #] &, list] // Dataset