I want to add 1 to all second elements but I am running into a "level" problem I believe here is my code:
list2 = {{{5, 1}}, {{2, 1}, {3, 1}}, {{7, 1}}, {{2, 3}}}
r1pow = Map[(# + {{0, 1}}) &, list2]
the result I got is:
{{{5, 2}}, {{0, 1}} + {{2, 1}, {3, 1}}, {{7, 2}}, {{2, 4}}}
my desired result is:
{{{5, 2}}, {{2, 2}, {3, 2}}, {{7, 2}}, {{2, 4}}}
as you can see it is giving a problem for my second element {{2, 1}, {3, 1}}, how can i fix this problem?
list2[[All, All, 2]] = list2[[All, All, 2]] + 1or shorterlist2[[All, All, 2]]++– ciao Apr 28 '14 at 00:08