Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Using Part

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77057] Using Part
  • From: Clifford Martin <camartin at snet.net>
  • Date: Sat, 2 Jun 2007 04:15:18 -0400 (EDT)

  Group,

I need some educational help. Below is a list of lists I'm trying to manipulate. Notice that the date is in the 6th place in each list.  What I want to do is 1) identify the lists with identical dates and 2) once I've done that add the third element of each list with identical dates together and 3) eliminate the two original lists.

{{{16871,I7,614,48876,850,{2006,12,2}},{16871,I7,538.3,49803,850,{2007,1,8}},
{16871,I7,474.8,50655,850,{2007,2,1}},{16871,I7,428.1,51430,850,{2007,2,20}},
{16871,I7,74.9,51430,850,{2007,2,20}},{16871,I7,535,52348,850,{2007,3,20}},
{16871,I7,395.9,53383,850,{2007,5,9}}}

So what I would end up with would be:

{{{16871,I7,614,48876,850,{2006,12,2}},{16871,I7,538.3,49803,850,{2007,1,8}},
 {16871,I7,474.8,50655,850,{2007,2,1}},{16871,I7,503,51430,850,{2007,2,20}},
  {16871,I7,535,52348,850,{2007,3,20}},{16871,I7,395.9,53383,850,{2007,5,9}}}
 
There is something about using Part that I'm not understanding. In the list below if I say:
 Part[list,4,6]==Part[list,5,6] I get
 True 
 
 but if I try to find it with an anonymous function like
 Select[list,Part[#1,6]==Part[#2,6] this doesn't find it. Clearly I'm not understanding how to use these functions with Part. I've tried many variations of this and it just shows I'm not understanding something fundamental.
 
  Thanks for your help in advance.

Cliff


  • Prev by Date: Re: Recursive FindRoot with initial values as a list
  • Next by Date: Re: How to change symbolic values to numbers
  • Previous by thread: possible mistake in FullGraphics documentation
  • Next by thread: Re: Using Part