MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mapping Functions That Take More Than One Argument


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


  • Prev by Date: mapping of function revisited
  • Next by Date: Re: Mapping Functions That Take More Than One Argument
  • Previous by thread: Re: Mapping Functions That Take More Than One Argument
  • Next by thread: Re: Mapping Functions That Take More Than One Argument