Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Simple list operation
Replies: 7   Last Post: Aug 10, 2005 3:49 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steve Gray

Posts: 129
Registered: 12/4/04
Simple list operation
Posted: Aug 9, 2005 3:44 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


Not having used Mathematica for months, I have forgotten some of the little I knew.

I have a list of lists like this:

test = { {{4, 5}, {5, 9}, {6, 2}},
{{2, 3}, {3, 5}},
{{7,1}, {9, 8}, {0, 7}, {2, 8}},
{{4, 3}, {6, 5}}};
test // ColumnForm
{{{4, 5}, {5, 9}, {6, 2}},
{{2, 3}, {3, 5}},
{{7, 1}, {9, 8}, {0, 7}, {2, 8}},
{{4, 3}, {6, 5}}}

What I want to do is just remove the last element in each sublist, with this result:

{{{4, 5}, {5, 9}},
{{2, 3}},
{{7, 1}, {9, 8}, {0, 7}},
{{4, 3}}}

There must be some simple functional way to do this, but I haven't found it.
I will appreciate any tips. Thank you.

Steve Gray




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.