Update
It was a bug in the documentation of V10.0, this functionality was not implemented yet, and V10.1 changed the documentation, removing it. It's a pity, because it's a very useful operations, common in other languages like R
. I miss data.frame
like notation in Mathematica.
In the new guide Computation With Structured Datasets we can find this part, on how to change a Dataset
But if we create a Dataset
like:
ds=Dataset[{<|"a"->1,"b"->"x"|>,<|"a"->2,"b"->"y"|>,<|"a"->6,"b"->"z"|>}];
And then make:
ds[[1, 1]] = 2
Or, closer to my real case test:
ds[[All, "a"]] = Accumulate@Normal@ds[[All, "a"]]
We get an error:
"Part specification ds[[1,1]] is longer than depth of object"
"Part specification ds[[All,1]] is longer than depth of object. "
Is this a Bug?
Setting is not working on Dataset
as stated by documentation.
StringReplace[%,"V10.0.1"-> "V10.0.2"]
$\endgroup$StringReplace[%%,"V10.0.1"-> "V10.1.0"]
$\endgroup$R
, it's a very natural way to do Data Frame manipulations. $\endgroup$