# Modify all the second elements of every pair in a list of pairs

I have a list in the form {{a, 1}, {b, 2}, {c, 3}}.

Let's say I want to operate a transformation on all the second elements of each sublist, but this transformation is a function of them all together. As an example I want to Standardize them.

At the moment I've implemented this with Transpose.

mylist = {{a, 1}, {b, 2}, {c, 3}};
newlist = Transpose[{mylist[[All, 1]], Standardize[mylist[[All, 2]]]}]


and the output is correctly

{{a, -1}, {b, 0}, {c, 1}}


I find this a little cumbersome, this approach can become complicated and hard to read sometimes. Isn't there a more natural way?

-
You could do newlist = mylist; newlist[[All, 2]] = Standardize[newlist[[All, 2]]];, but I don't consider it any more natural than what you have. – J. M. Jun 10 '13 at 15:30
I am positive this question is a duplicate, though perhaps the original is on StackOverflow. I'd appreciate help finding it. – Mr.Wizard Jun 10 '13 at 15:32
This is related but it does not expressly describe passing the entire column to the function; I know there is a question that does. – Mr.Wizard Jun 10 '13 at 15:37
Another slight variation (but hardly more natural either): MapAt[Standardize, #\[Transpose], 2]\[Transpose] &@mylist – TomD Jun 10 '13 at 16:54
Duh, deleting my remark, which is just a repeat of what 0x4A4D said. But I like that method. – Todd Gayley Jun 10 '13 at 18:18

Apply[Transpose[{#1,Standardize[#2]}]&,Transpose[mylist]]

Thread[{First[Thread[myList]], Standardize[Last[Thread[myList]]]}]