Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.3K Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How do I replace some elements of my list? {{a,b},{c,d}} ->{{1,b},{2,d}}

Hi, I want replace some elements of my list "res" .


res = {{{a,b},{c,d},{e,f}}}

lis ={{1,2,3}}

I 'd like obtein :

rep = {{{1,b},{2,d},{3,f}}}

How to do with the command ReplacePart?

Thanks a lot

5 Replies

Again, I am not sure whether you want MapThread here. You could try Map:

Map[Select[#, # <= 2 &] &, res]

or the short hand notation for that same thing:

Select[#, # <= 2 &] & /@ res

Cheers,

Marco

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