Re: Sorting Rows of a Matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg65112] Re: [mg65089] Sorting Rows of a Matrix
- From: Sseziwa Mukasa <mukasa at jeol.com>
- Date: Wed, 15 Mar 2006 06:28:24 -0500 (EST)
- References: <200603141100.GAA24159@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On Mar 14, 2006, at 6:00 AM, Gregory Lypny wrote: > Hello everyone, > > How can I sort the rows of a matrix by using one or more of the > columns as sort keys just like in a spreadsheet? For example, if > matrix M is 12 x 2 with numbers in the first column and unordered > month numbers in the second, how would I order the rows by month? Sort[list,#1[[2]]<#2[[2]]&] Regards, Ssezi
- References:
- Sorting Rows of a Matrix
- From: Gregory Lypny <gregory.lypny@videotron.ca>
- Sorting Rows of a Matrix