Message Boards Message Boards

0
|
11511 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Replace values of nested list without resorting to part assignment?

I have a nested list of financial data such as:

test={{{2000,1,4},-5.93336},{{2000,1,5},1.09736},{{2000,1,6},7.19}}

I would like to replace [[All,2]] with

Log[1+[[All,2]]/100]

using ReplacePart instead of part assignment, such as

test[[All, 2]] = Log[1 + (test[[All, 2]])/100]

How can I accomplish that?

Thank you

2 Replies

Not what you requested, but the same effect:

Thread[{test[[All, 1]], Log[1 + test[[All, 2]]/100]}]

(*  {{{2000, 1, 4}, -0.0611667}, {{2000, 1, 5}, 0.0109138}, {{2000, 1, 6},  0.0694328}}  *)
POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract