Re: More help on sorting out a large list
- To: mathgroup at smc.vnet.net
- Subject: [mg58382] Re: More help on sorting out a large list
- From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
- Date: Thu, 30 Jun 2005 04:37:18 -0400 (EDT)
- Organization: Uni Leipzig
- References: <d9t15f$j7b$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, try Split[data, #1[[5]] == #2[[5]] && #1[[6]] == #2[[6]] &] to group the data. But your posting is unclear what "take the average" mean. Is it the average over all columns ? Regards Jens "tornado78" <tornado78 at hotmail.com> schrieb im Newsbeitrag news:d9t15f$j7b$1 at smc.vnet.net... > Ok here's a problem I've been trying to figure > out for awhile. I have a large XYZ sorted > matrix and what i need is to look at two columns > x,y and and if it is a unique point keep the > row, if there are multiple rows with same x,y > pair i need to remove all of them and leave only > the middle Z row or the average of the middle > two Z rows > > for example > > x y z > {1, 6, 4, 8, 4, 5, 8, 3} drop > {1, 3, 5, 8, 4, 5, 3, 3}--take > {5, 3, 6, 8, 4, 5, 6, 3} drop > {4, 5, 3, 4, 5, 6, 1, 0}drop > {2, 5, 4, 3, 5, 6, 9, 1}\ > {1, 2, 5, 4, 5, 6, 7, 8} -take average > {3, 5, 6, 3, 5, 6, 6, 4}drop > {5, 3, 5, 2, 7, 8, 2, 5}----take > > > thanks for any help >