Group Abstract Group Abstract

Message Boards Message Boards

3
|
12.2K Views
|
5 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Error changing Dataset using Part in V10

Posted 11 years ago

In the new guide [Computation With Structured Datasets][1] we can find this part, on how to change a [Dataset][2]

![enter image description here][3]

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.

Without this operation, it's very difficult to use Dataset in real world applications.

Related post in StackExchange

POSTED BY: Rodrigo Murta
5 Replies

Documentation glitch. Thank you for pointing it out.

I reported it to documentation staff.

Sorry for the inconvenience.

POSTED BY: Bruce Miller

Yes, that appears not to work. Although accessing parts by using things like ds[[All, "a"]] does work as expected.

POSTED BY: David Reiss

7 years have passed! I still miss this functionality in Dataset. https://mathematica.stackexchange.com/q/52414/2266

POSTED BY: Rodrigo Murta

No upgrade for V10.0.2.0.

POSTED BY: Rodrigo Murta

Can parts of Dataset be assigned new values as of version 10.0.2.0? If so, what is the syntax?

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard