Re: Beginner: List Indexing and Assignment
- To: mathgroup at smc.vnet.net
- Subject: [mg94496] Re: [mg94486] Beginner: List Indexing and Assignment
- From: C Rose <cjr.list.alias.1 at me.com>
- Date: Mon, 15 Dec 2008 07:42:41 -0500 (EST)
Thanks Bob. Chris >a = {{1, 2, 3}, {4, 5, 6}}; > >a /. x_ /; x > 2 -> -1 > >{{1, 2, -1}, {-1, -1, -1}} > >a /. _?(# > 2 &) -> -1 > >{{1, 2, -1}, {-1, -1, -1}} > >Map[If[# > 2, -1, #] &, a, {2}] > >{{1, 2, -1}, {-1, -1, -1}}