Re: Mapping Functions That Take More Than One Argument
- To: mathgroup at smc.vnet.net
- Subject: [mg69907] Re: Mapping Functions That Take More Than One Argument
- From: dimmechan at yahoo.com
- Date: Wed, 27 Sep 2006 06:04:39 -0400 (EDT)
- References: <efaclu$1uo$1@smc.vnet.net>
Dear Gregory, You can use Map (Drop[#1, 1] & ) /@ {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} {{2, 3}, {5, 6}, {8, 9}} Here are alos some alternatives (Delete[#1, 1] & ) /@ {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} {{2, 3}, {5, 6}, {8, 9}} (Rest[#1] & ) /@ {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} {{2, 3}, {5, 6}, {8, 9}} {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}} //. {a___, {x_, y_, z_}, b___} -> {a, {y, z}, b} {{2, 3}, {5, 6}, {8, 9}} Drop[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, {}, {1}] {{2, 3}, {5, 6}, {8, 9}} Apply[{##2} & , lst, {1}] {{2, 3}, {5, 6}, {8, 9}} lst/.{x_Integer,y_Integer,z_Integer}\[Rule]{y,z} {{2,3},{5,6},{8,9}} Hope I help you a bit. Regards Dimitris