Suppose I have the following dataset:
dataset = Dataset[{
<|"t" -> -3, "v" -> 9|>,
<|"t" -> -2, "v" -> 4|>,
<|"t" -> -1, "v" -> 1|>,
<|"t" -> 0, "v" -> 0|>,
<|"t" -> 1, "v" -> 1|>,
<|"t" -> 2, "v" -> 4|>,
<|"t" -> 3, "v" -> 9|>
}]
I want to find an interpolation polynom using Interpolation
.
What I do now is
Interpolation[
Thread[{
dataset[All, "t"] // Normal,
dataset[All, "v"] // Normal
}]
]
But I am sure there is a more concise way to do it.
EDIT:
What if my data set is a 3 columns one, and I want to find a t
vs v
or a t
vs u
interpolation? For example,
dataset=Dataset[{
<|"t" -> -3, "v" -> 0, "u" -> -5|>,
<|"t" -> -2, "v" -> 3, "u" -> 8|>,
<|"t" -> -1, "v" -> -3, "u" -> -9|>,
<|"t" -> 0, "v" -> -3, "u" -> 4|>,
<|"t" -> 1, "v" -> -8, "u" -> -10|>,
<|"t" -> 2, "v" -> 2, "u" -> 8|>,
<|"t" -> 3, "v" -> 4, "u" -> -10|>
}]
I tried Interpolation[dataset[All, {"t", "v"}]//Normal]
is not good. Any suggestion?